1.1.2 • Published 9 months ago

@uniwebcms/tutorial-starter v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

tutorial-starter

tutorial-starter is an npm library that helps you quickly create a tutorial website using Docusaurus.

Getting Started

Prerequisites

  • Node.js (version 16.14 or higher)
  • npm (Node Package Manager) or Yarn

Quick Start

To create a new tutorial website, use the following command:

npx @uniwebcms/tutorial-starter@latest init [project-name]

This will initialize a new tutorial website project in the project-name directory under your project root. The `project-name` argument is optional. If you don't provide a project name, the default name "tutorial" will be used.

Project Structure

Once initialized, the project structure will look like this:

my-tutorial-website/
    ├── README.md
    ├── babel.config.js
    ├── docs
    │   └── sample-doc.mdx
    ├── docusaurus.config.js
    ├── package.json
    ├── scripts
    │   ├── checkUpdate.js
    │   └── prebuild.js
    ├── sidebars.js
    ├── src
    │   ├── components
    │   │   └── index.js
    │   ├── css
    │   │   └── custom.css
    │   └── pages
    │       └── index.mdx
    └── static
        ├── img
        │   ├── favicon.png
        │   ├── logo.svg
        │   ├── sample.png
        │   ├── uniweb_black.svg
        │   └── uniweb_white.svg
        └── schemas
            └── sample.json
  • The docs directory contains the documentation files for your tutorial website.
  • The src directory contains the component, css file and pages.
  • The static directory contains the static assets files such as image and json files.
  • The docusaurus.config.js file is the configuration file for Docusaurus.
  • The sidebar.js file is the configuration file for website sidebar.

Local Development

To start a local development server and preview your tutorial website, run the following commands:

cd my-tutorial-website
npm install
npm start
# OR
yarn install
yarn start

Build and serve locally for testing

cd my-tutorial-website
npm run build:dev
npm run serve:dev
# OR
yarn build:dev
yarn serve:dev

The built website will be available in the build under my-tutorial-website directory.

This will start the development server, and you can view the website at http://localhost:3000.

Building for Production

To build the website for production, you have the following two options:

Build and locally and commit manually

cd my-tutorial-website
npm run build:prod
# OR
yarn build:prod

The built website will be available in the dist under the project root directory, you can them manually commit it.

Build using GitHub Actions workflow

cd my-tutorial-website
npm run build:gh
# OR
yarn build:gh

This script should be used in a workflow executed by GitHub Actions to provide the necessary environment variables. The built website will be available in the dist directory under the project's root. Once the build artifact is uploaded to GitHub Pages, the website can be visited via the GitHub Pages URL.

Contributing

We welcome contributions to website-starter. Feel free to submit bug reports, feature requests, or pull requests on our GitHub repository.

License

This project is licensed under the MIT License.

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.31

9 months ago

1.0.30

9 months ago

1.0.29

9 months ago

1.0.28

9 months ago

1.0.27

9 months ago

1.0.26

9 months ago

1.0.25

9 months ago

1.0.24

9 months ago

1.0.23

9 months ago

1.0.22

9 months ago

1.0.21

9 months ago

1.0.20

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.16

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago