Skip to content

SuperAayush/shifu.dev

Repository files navigation

Shifu Website

This website is built using Docusaurus 2, a modern static website generator.

Usage

Development

$ yarn # install packages

$ yarn start # en SPA
$ yarn start --locale zh-Hans # zh-Hans SPA

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ yarn build # en and zh-Hans
$ yarn run serve

# build SPA of a specific language
$ yarn build --locale en
$ yarn build --locale zh-Hans
$ yarn run serve

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

Using SSH:

$ USE_SSH=true yarn deploy

Not using SSH:

$ GIT_USER=<Your GitHub username> yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.

Docusaurus

Admonition

Reference: https://docusaurus.io/docs/next/markdown-features/admonitions

Use grammar below to add a admonition:

:::note
A common note.
:::

:::caution Don't use this in production
A caution with title.
:::
  • note: Use note if you don't want to block the reading process of the reader.
  • info: Use info to provide some explanations of the content.
  • tip: Use tip if you want user to jump to another page or site.
  • caution
  • danger

Internationalization

Reference: https://docusaurus.io/docs/next/i18n/tutorial#translate-plugin-data

  • Translate React pages
  • Translate docs
    • Copy and translate docs in i18n/zh-Hans/docusaurus-plugin-content-docs/current.
  • Translate plugin data
    • Run yarn run write-translations --locale zh-Hans to generate json files for translating.
    • Translate
      • sidebar items: i18n/zh-Hans/docusaurus-plugin-content-docs/current/current.json
      • navbar and footer items: i18n/zh-Hans/docusaurus-theme-classic/*.json
  • Check translation
    • Run yarn start --locale zh-Hans to start website in zh-Hans for local development. (Each locale is a distinct standalone single-page application: it is not possible to start the Docusaurus sites in all locales at the same time.)

About

Official website of Shifu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.8%
  • SCSS 15.6%
  • CSS 1.6%