this is mainly for showing something via Nextra site generator. visit the deployed site effect here.
the main stack is nodejs (nextjs), while the plugin scripts are written in python.
we need to both init them:
nodejs:
# install by `project.json`
npm installpython (poetry):
# install by pyproject.toml
poetry updatenpm run dev# build but not deploy (useful for checking if build worked)
npm run build
# build and deploy
npm run deploynotice: make sure there exists ./out/.nojekyll file (an empty file). otherwise the github pages will be failed finding javascript and stylesheets.
|= <this_project>
|= docs
|- index.html
|- ...
|= <temp_dir>
|= code-snippet-book # symlinked from `<this_project>/docs`
|- index.html
|- ...
npm run build
poetry run python3 -m http.server 3001 -d <temp_dir>visit http://localhost:3001/code-snippet-book to see effect.