Marp-based slides for a CodeHub meetup talk on home networking and Pi-hole.
- Node.js 20.19 or newer
- pnpm 11 or newer
- Docker with Compose support (required to render Mermaid diagrams through Kroki)
Install dependencies and start the local slide server:
pnpm install
pnpm kroki:up
pnpm devpnpm dev builds dist/index.html (including Kroki Mermaid rendering),
serves dist/, and rebuilds when slides.md changes.
By default it uses port 8080; if 8080 is busy it automatically uses the next available port and prints the URL.
When you are done, stop local Kroki services:
pnpm kroki:downIf Kroki is running on a different host/port, set the endpoint before running pnpm dev or pnpm build:
KROKI_ENDPOINT=http://127.0.0.1:8000 pnpm buildBuild the static site for GitHub Pages:
pnpm buildpnpm build renders Mermaid diagrams at build time by sending diagram source to
Kroki and saving the returned SVGs as files under dist/assets/diagrams/. Each
diagram is referenced from dist/index.html as an <img> tag.
Export a PDF copy of the deck:
pnpm exportThe HTML build is written to dist/index.html. The PDF export is written to dist/slides.pdf.
Store images under assets/ and reference them from slides.md
with relative paths such as ./assets/sponsors/acme.png.
That works in both places because:
- local development serves
dist/index.html - the build copies
assets/todist/assets/ - GitHub Pages publishes the same built files from
dist/
Avoid absolute URLs such as /assets/acme.png, because a project
site is published under /intro-to-home-networking/ rather than the
domain root.
Standard Markdown image:
While pnpm dev is running, changes to files inside assets/ trigger a rebuild automatically.
This repo is designed to deploy from GitHub Actions to GitHub Pages.
- Create a new repository under the CodeHubOrg organization with the name
intro-to-home-networking. - Push this folder to the
mainbranch. - In the repository settings, set Pages source to GitHub Actions.
- Wait for the first workflow run to finish, then open the published Pages URL.
Deployment and CI builds start Kroki containers in GitHub Actions before running
pnpm build, so published output matches local build-time rendering.
For an organization project site, the live URL will usually be:
https://codehuborg.github.io/intro-to-home-networking/
This repository follows gitflow for version control:
mainbranch: stable, release-ready code that is deployed to GitHub Pages.developbranch: integration branch for features and fixes.- Feature/fix branches: branch from
developwith naming patternfeature/<slug>orfix/<slug>.
Workflow:
Follow gitflow strictly for day-to-day changes: create a new feature or fix
branch from develop before you start editing, and avoid making working
changes directly on develop.
- Create a feature or fix branch from
develop. - Make your changes, test locally with
pnpm dev. - Push the branch and open a PR against
develop. - After review and merge to
develop, the build test workflow (test-build.yml) runs. - When ready for release, merge
developintomainto trigger the Pages deployment.
Both workflows use Kroki:
.github/workflows/test-build.ymlvalidates lint/build with Kroki on push and PR..github/workflows/deploy-pages.ymlpublishes Pages after pushes tomain.
If you want to expand the deck later, add images or diagrams under an assets/ directory and reference them from slides.md.