Merge pull request #4 from D-Modem/claude/project-thread-cwmrpa

Sites: build with Zensical
This commit is contained in:
Neo authored and GitHub committed 2026-11-05 17:19:40 -08:00
commit 0c35d38f25
7 files changed
+15 -19

No files matched your search

+2 -4
View File
@@ -1,6 +1,6 @@
# A D-Modem repository's GitHub Pages site: the shared theme and settings
# (pages/, tools/site.sh) around the repository's mkdocs.yml and docs/, built
# with mkdocs build --strict, then deployed to d-modem.github.io/<repo>/.
# with Zensical (zensical build --strict), then deployed to d-modem.github.io/<repo>/.
#
# Called from each repository's .github/workflows/pages.yml:
#
@@ -67,9 +67,7 @@ jobs:
- run: .site/brand/tools/site.sh . prepare
- if: inputs.prepare != ''
run: ${{ inputs.prepare }}
- run: mkdocs build --strict
env:
NO_MKDOCS_2_WARNING: "1"
- run: zensical build --strict
- uses: actions/upload-pages-artifact@v5
with:
path: site
+4 -5
View File
@@ -3,15 +3,14 @@
Each repository has a site at `https://d-modem.github.io/<repo>/`, and the
suite has one at <https://d-modem.github.io/> (the
[D-Modem.github.io](https://github.com/D-Modem/D-Modem.github.io)
repository). They are [MkDocs](https://www.mkdocs.org/) sites with the
[Material](https://squidfunk.github.io/mkdocs-material/) theme, and they all
share what lives here:
repository). They are built with [Zensical](https://zensical.org/), the successor to
Material for MkDocs by the same team, and they all share what lives here:
| Path | What it is |
| --- | --- |
| `pages/mkdocs-base.yml` | The shared settings: the theme, light and dark schemes, Markdown extensions, search |
| `pages/mkdocs-base.yml` | The shared settings: the theme, light and dark schemes, Markdown extensions, search (in `mkdocs.yml`'s format, which Zensical reads) |
| `pages/theme/` | The theme's overrides: the suite's bar across the top, the Rainbow Book accent, the mark as logo and favicon |
| `pages/requirements.txt` | The pinned MkDocs and Material versions |
| `pages/requirements.txt` | The pinned Zensical version |
| `tools/site.sh` | Puts the above into a repository and builds or previews its site |
| `.github/workflows/site.yml` | The reusable workflow that builds every site and deploys it to Pages |
+2 -1
View File
@@ -1,4 +1,5 @@
# The D-Modem sites' shared MkDocs settings. A repository's mkdocs.yml starts
# The D-Modem sites' shared settings, for Zensical (which reads MkDocs'
# mkdocs.yml format). A repository's mkdocs.yml starts
# with "INHERIT: .site/mkdocs-base.yml" (tools/site.sh puts this file and the
# theme in .site/) and adds its site_name, site_url, repo_url, nav and
# extra.repo (its name, which picks its Rainbow Book colour).
+1 -2
View File
@@ -1,3 +1,2 @@
# the sites' build (tools/site.sh, .github/workflows/site.yml)
mkdocs==1.6.1
mkdocs-material==9.8.0
zensical==0.1.0
+1 -1
View File
@@ -1,5 +1,5 @@
/* The D-Modem sites: brand's neutrals and type, the repository's Rainbow Book
(--suite-accent, set in main.html) as Material's primary and accent. */
(--suite-accent, set in main.html) as the theme's primary and accent. */
@font-face {
font-family: "Sauce Code Pro";
src: local("SauceCodePro Nerd Font Mono"), local("SauceCodePro Nerd Font"), local("Source Code Pro");
+2 -2
View File
@@ -1,4 +1,4 @@
{#- The D-Modem sites' theme: Material with the suite's bar on top and the
{#- The D-Modem sites' theme: Zensical's with the suite's bar on top and the
repository's Rainbow Book as its accent (extra.repo in mkdocs.yml). -#}
{% extends "base.html" %}
@@ -8,7 +8,7 @@
"menu": "#3ddc84", "bbs": "#3d8bff", "go3270": "#a66bff",
"brand": "#f2f4fa", "D-Modem.github.io": "#3dff9a"
} -%}
<style>:root { --suite-accent: {{ books.get(config.extra.repo, "#3dff9a") }}; }</style>
<style>:root { --suite-accent: {{ books[config.extra.repo] or "#3dff9a" }}; }</style>
<link rel="stylesheet" href="{{ 'assets/suite/d-modem.css' | url }}">
{{ super() }}
{% endblock %}
+3 -4
View File
@@ -5,11 +5,10 @@
#
# prepare puts the shared theme and settings in REPO_DIR/.site/ (the repo's
# mkdocs.yml starts with "INHERIT: .site/mkdocs-base.yml"); build then runs
# mkdocs build --strict into REPO_DIR/site/, serve a live preview on
# zensical build --strict into REPO_DIR/site/, serve a live preview on
# http://127.0.0.1:8000/. Needs pages/requirements.txt installed
# (pip install -r pages/requirements.txt).
set -eu
export NO_MKDOCS_2_WARNING=1
brand=$(cd "$(dirname "$0")/.." && pwd)
repo=${1:?usage: tools/site.sh REPO_DIR [build|serve|prepare]}
what=${2:-build}
@@ -21,7 +20,7 @@ cp "$brand/pages/mkdocs-base.yml" .site/mkdocs-base.yml
cp "$brand/avatar/mark.svg" .site/theme/assets/suite/mark.svg
case $what in
prepare) ;;
build) mkdocs build --strict ;;
serve) mkdocs serve ;;
build) zensical build --strict ;;
serve) zensical serve ;;
*) echo "tools/site.sh: $what: build, serve or prepare" >&2; exit 2 ;;
esac