tiktok-sparo/apps/website
2024-08-28 16:42:28 -07:00
..
config chore: config dist folders for build phase 2024-03-01 23:32:43 -08:00
docs Our demo forgot the step where you install Sparo 😆 2024-08-22 16:42:49 -07:00
i18n/zh-cn chore: fix ci 2024-08-28 16:42:28 -07:00
src Improve website logo appearance in dark mode 2024-02-26 22:33:20 -08:00
static chore: update duplicated strings anywhere 2024-03-15 12:39:47 -07:00
babel.config.js npx create-docusaurus@latest website classic 2024-02-21 22:17:23 -08:00
build.js fix: website build 2024-08-26 22:13:19 -07:00
docusaurus.config.js Configure lunr to search zh content 2024-08-22 13:55:53 -07:00
package.json Configure lunr to search zh content 2024-08-22 13:55:53 -07:00
README.md Machine translation 2024-08-22 13:40:37 -07:00
sidebars.js feat: update website for sparo pull and sparo git-pull 2024-04-09 16:04:42 -07:00

Website

This is the Docusaurus project for the Sparo website.

Development

  1. Install the monorepo dependencies using RushJS:

    rush install
    rush build
    
  2. Launch the local development server:

    cd apps/website
    rushx start
    

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

Because this site is relatively small, searching is performed client-side using the docusaurus-lunr-search plugin based on Lunr.js.

Notes:

  • Site search is broken when using the localhost debug server (rushx start), but it works correctly for real deployments (rushx deploy)
  • @algolia/client-search is included in package.json dependencies only because @docusaurus/preset-classic includes it as a peer dependency.

Managing translations

Instructions for internationalization with Docusaurus: https://docusaurus.io/docs/i18n/introduction

The supported locales for this project can be found in the "i18n" section of docusaurus.config.js.

NOTE: Each locale is built as a distinct standalone single-page application. The localhost dev server builds only one locale at a time. To view multiple locales together, you must deploy the site.

Common commands:

  • rushx start --locale zh-cn - launch the localhost dev server in the specified language.

  • rushx write-translations --locale zh-cn - Update the i18n/*.json files with any new strings.

Deployment

  1. If you will manually copy the files to a server, you can build the apps/sparo/build folder like this:

    cd apps/website
    rushx build
    
  2. To automatically deploy to GitHub Pages (as an administrator):

    # If you are using HTTPS authentication for GitHub:
    cd apps/website
    GIT_USER=<Your GitHub username> rushx deploy
    
    # If you are using SSH authentication for GitHub:
    USE_SSH=true rushx deploy
    

See also