Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

tips

How to create this note?

  1. Write articles by Markdown.

  2. Build and preview the Jupyter Book 2 site.

  3. Publish the generated HTML with GitHub Pages.

TL;DR

This repository uses Jupyter Book 2 / MyST. Build and preview are separate steps:

このリポジトリは Jupyter Book 2 / MyST を使っている。build と preview は 分けて考える。

Directory structure

├─ src
│  ├─ index.md
│  └─ ...
├─ myst.yml
└─ requirements.txt

Local preview

jupyter-book build --site
jupyter-book start --port 3000

Then open http://localhost:3000.

Build static HTML for publishing

BASE_URL=/jb-notes jupyter-book build --html --ci

The generated static site is written to _build/html.

Publish

Publishing is handled by GitHub Actions:

  1. Install Python dependencies from requirements.txt.

  2. Run jupyter-book build --html --ci.

  3. Push _build/html to the gh-pages branch with ghp-import.

This matches the current GitHub Pages setting where deployments are allowed from the gh-pages branch.

References: