Skip to content

Site targets, download links and hand-written pages in the navigation - #138

Merged
markbac merged 1 commit into
mainfrom
site-targets-and-downloads
Oct 16, 2026
Merged

markbac merged 1 commit into
mainfrom
site-targets-and-downloads

Conversation

@markbac

@markbac markbac commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

These are the features needed to publish markbac.github.io and tarf.co.uk from one py-doc project:

  • site.targets (MkDocs): one site project builds several sites, each from its own config file that INHERITs mkdocs.yml and changes only what differs (address, site_dir, home page). py-doc site build builds every target, and --target NAME builds one. A target whose file is missing, doesn't take in the navigation, or reads pages from another docs_dir is reported. Two targets that build to the same folder are refused before building.
  • site.downloads: the first page of each document links the files py-doc build made for it (pdf, docx, pptx, html), copied into downloads/ beside the pages (public/<doc>/downloads/ for Starlight). A file not built yet is left out with a warning that names the build command.
  • site.pages: hand-written pages, such as a blog for Material's blog plugin, are added to the navigation py-doc writes, after the documents.
  • Tool image: adds mkdocs-redirects==1.2.2, so old URLs can redirect.

The user guide (Web sites chapter) and the requirements (FR-125 to FR-127, with traceability) are updated.

Testing

  • pytest: 1026 passed, 13 skipped. The site and config tests were rerun after the last change: 53 passed.
  • ruff check: clean. py-doc lint --engine builtin --strict on the changed docs: 0 issues.
  • Rebuilt the tool image and built a two-target site (markbac.github.io and tarf.co.uk) end to end. Both sites came out with their own home pages and the redirects plugin loaded.

🤖 Generated with Claude Code

…ist hand-written pages

- site.targets: a MkDocs site project builds a site per config file (for
  example mkdocs.yml and mkdocs.tarf.yml, which INHERITs it), sharing the
  pages and navigation. `py-doc site build --target NAME` builds one; two
  targets that build to the same folder are refused before building.
- site.downloads: each document's first page links the Word, PDF,
  PowerPoint or HTML files `py-doc build` made for it, copied beside the
  site. A file not built yet is left out with a warning.
- site.pages: pages of the user's own (a blog, an about page) are added to
  the navigation after the documents.
- The tool image gains mkdocs-redirects, so moved pages keep their old
  addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markbac
markbac merged commit b78dac3 into main Oct 16, 2026
6 checks passed
@markbac
markbac deleted the site-targets-and-downloads branch October 19, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant