A template for creating interactive blog posts using the Distill.pub format. Includes support for mathematical notation, citations, and interactive visualizations.
Click "Use this template" on GitHub to create your own repository.
git clone <your-repo-url>
cd <your-repo-name>
npm installnpm run devView at http://localhost:8080. Changes auto-reload.
All content is in src/index.ejs. Update:
Front matter (lines 24-46):
title: Post titledescription: Post descriptionauthors: Author names, URLs, and affiliations
Article content (line 58 onwards):
- Write content using standard HTML tags (
<p>,<h2>,<h3>, etc.) - Use
$...$for inline math and$$...$$for display math - Reference citations with
<d-cite key="citation-key"></d-cite>
Table of contents (lines 59-78):
- Update to match your section headings
- Link to section IDs using
href="#section-id"
Add BibTeX entries to static/references.bib. Reference them in your post using the citation key:
<d-cite key="your-citation-key"></d-cite>Create JavaScript modules in src/diagrams/:
- Create a new file (e.g.,
src/diagrams/my-viz.js) - Export an initialization function:
export function initMyViz() {
// Your visualization code
}- Import and call it in
src/index.js:
import { initMyViz } from './diagrams/my-viz.js';
initMyViz();Examples are in src/diagrams/carousel.js and src/diagrams/neural-network.js.
Full-width: Add class="l-screen" to <figure> elements
<figure class="l-screen">
<!-- Content spans full screen width -->
</figure>Regular-width: Use standard <figure> without the class
npm run buildOutput is in public/.
Push to the main branch. GitHub Actions automatically builds and deploys to GitHub Pages.
Enable GitHub Pages:
- Go to repository Settings > Pages
- Set Source to "GitHub Actions"
- Your site will be at
https://<username>.github.io/<repo-name>/