commit b7f51cf us.anthropic.claude-sonnet-4-6

This is the marketing and documentation website for the BookStack application, built as a static site using Hugo. It follows a content-pipeline architecture: Markdown/HTML source files in content/ are processed by Hugo templates in themes/bookstack/layouts/, compiled SCSS provides styling, a Perl script builds a SQLite search index from the output HTML, and a PHP script packages hack content into installable ZIP modules. The only dynamic runtime component is a single PHP file (search.php) that queries the SQLite index to power site search.

Start Tour
10 steps
Explore Systems
8 subsystems
Generate Docs
README + ARCHITECTURE.md
Static Site Generation
Hugo processes Markdown and HTML content files from content/, applies the custom bookstack theme, and outputs a fully static site to public/. Configuration in config/_default/hugo.toml controls permalinks, pagination, markup rendering, and module mounts.
2 steps
Custom Hugo Theme
The bookstack theme under themes/bookstack/ provides all layout templates (index, blog, docs, hacks, about, 404), reusable partials (header, footer, navigation menus, pagination, sponsor list), and shortcodes (YouTube/PeerTube embeds, table of contents, hack file display).
1 steps
SCSS Styling Pipeline
SCSS source files under themes/bookstack/sass/ are compiled by the Dart Sass CLI into a single CSS bundle served as static/css/styles.css. Partials cover reset, variables, mixins, typography, layout grid, buttons, header, blog, code highlighting, and component blocks.
1 steps
Site Search
A Perl script (search/webidx.pl) crawls the built HTML output, extracts text from within <main> tags, and inserts word-to-page mappings into a SQLite database (search.db). At runtime, a PHP script (themes/bookstack/static/search.php) accepts query strings, looks up matching page IDs, and returns JSON. Front-end JS in script.js handles input debouncing, result categorisation (docs/hacks/blog/other), and keyboard navigation of the dropdown dialog.
2 steps
Hacks Content Submodule
Customization hack articles live in a separate Codeberg git repository included as a submodule at hacks/. Hugo module mounts make the content available under content/hacks/ and also expose head.html files as static assets. Each hack page has metadata (Author, Tested, Updated) used to render attribution, version warnings, and the module install command.
Hack Module Builder
build-hack-modules.php iterates over every hack directory, reads frontmatter metadata from index.md, and packages the hack's files into a structured ZIP archive conforming to the BookStack Theme System Module format. Special file path remapping handles blade.php views and head.html injection, and functions.php use-statements are merged automatically.
1 steps
Documentation Content
Admin and user documentation pages live under content/docs/ as Markdown files with TOML front matter. Menu structure is declared in menus.toml and rendered via partials (menu_admin_docs.html, menu_user_docs.html, menu_docs_list.html), with the type field (admin-doc / user-doc) used to conditionally display the appropriate sidebar and section header.
2 steps
Build & Deployment Toolchain
npm scripts in package.json orchestrate the full build pipeline: Sass compilation, Hugo site generation, SQLite search index creation, and hack module packaging. An rsync-based deploy script publishes to the production server. A Docker Compose service with a PHP-Apache image serves the built public/ folder locally for preview.
1 steps
124
Files
68
Scanned
8
Subsystems
10
Steps
Infrastructure

Scroll to zoom. Drag to pan.