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.

A Reusable Template for Building Websites with MyST Markdown

After rebuilding my personal website with MyST Markdown, I found myself wanting to share the setup with others. The configuration work -- GitHub Actions, pre-commit hooks, directory structure, deployment pipelines -- took real effort to get right. To make it easier for anyone to start from a working foundation, I created myst-website-template, a GitHub template repository that bundles everything into a single click.

Why a Template?

Starting a MyST site from scratch is straightforward if all you need is a single page. But a production-ready site involves more than content:

Setting all of this up by hand takes time and introduces opportunities for small mistakes. The template packages these pieces together so that a new project starts with a complete, tested setup rather than an empty directory.

What Is Included

Getting Started

  1. Go to the template repository and click Use this template to create a new repository.

  2. Open myst.yml and update the project title, author name, GitHub URL, and table of contents to match your content.

  3. Replace the placeholder pages in the book/ directory with your own Markdown files or Jupyter notebooks.

  4. Push to main. GitHub Actions will build the site and deploy it to GitHub Pages automatically.

That is all it takes. PR previews will also work once you connect Netlify and add the NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID secrets to your repository.

Customization

The template is designed to be modified. A few common adjustments:

To build locally, install the dependencies and run:

pip install -r requirements.txt
npm install -g mystmd
myst build --html

The output will be in _build/html/.

To start running the website locally, run:

myst start

Lessons Learned