How fluentpython/book-site works
1. Repository role
This is a Hugo-based static documentation site for the Fluent Python companion web site, not an application with a server-side runtime. The main product is generated HTML plus static assets published to fluentpython.com.
2. Build pipeline
The primary flow is: source content and templates in the repo are rendered by Hugo into a static site. The site also uses Hugo’s external AsciiDoc integration, so some pages are authored in AsciiDoc and processed through Asciidoctor during the build.
3. Content layer
The content/ tree is the main editorial source. It contains the home page, about page, lingo page, posts, and the large content/extra/ section with topic-focused articles. Many of these topic folders include code examples, diagrams, and supporting files alongside the prose.
4. Executable examples as content artifacts
Under content/extra/ there are Python scripts, C code, notebooks, and reference docs tied to individual articles. These are not a service layer; they are educational artifacts embedded in the content and referenced by the pages they explain.
5. Theme boundary
The site is built on the themes/cupper Hugo theme. That theme provides the base layouts, partials, shortcodes, CSS, JS, and example site; the top-level repository overrides or extends it with its own layouts/ and static/ content.
6. Presentation and rendering
layouts/ contains local template overrides such as the default list view and header partials. This is the main boundary where site-specific presentation differs from the upstream theme, while most shared rendering behavior remains in themes/cupper/layouts/.
7. Client-side assets
Static assets live in static/ and theme assets. These include syntax highlighting, search UI, service-worker registration, the web manifest, images, and a large static/data/flags/ dataset used by the emoji/flags content. These assets are delivered as-is with the generated site.
8. Data-driven content
Some sections, especially the emoji-related material, depend on structured static data rather than code execution. The static/data/flags/*/metadata.json files form a country/flag metadata store that supports those pages and any associated client-side rendering.
9. Tooling and dependencies
The root Gemfile and the README’s Asciidoctor references indicate a Ruby-based build dependency for converting AsciiDoc during Hugo builds. The repository also includes fix_dunder.py and deploy.sh as maintenance/deployment helpers.
10. Deployment target
The site is configured for Netlify through netlify.toml at the root and also within the theme. Deployment is therefore a static hosting pipeline: build on CI/Netlify, publish the generated Hugo output, and serve it via CDN.
11. Theme example site vs. live site
themes/cupper/exampleSite/ is reference content for the theme itself, separate from the production Fluent Python content. It demonstrates theme capabilities and is useful for understanding the theme boundary, but it is not the actual site content.
12. Architecture summary
The architecture is: editorial source content + embedded example files -> Hugo/Asciidoctor build -> theme templates and overrides -> static HTML/CSS/JS/data -> Netlify deployment. There is no application backend; the main integration points are content formats, theme templates, and static assets.
Main entry points: content Content tree · cupper Cupper theme · extra Extra articles · netlify.toml Netlify deploy
Components 19
Editorial content
Primary site source material authored for Hugo and Asciidoctor.
- Content tree · Main editorial source for pages, posts, and topic sections.
content - Home page · Top-level site entry page.
content/_index.md - About page · Site background and author information.
content/about.md - Lingo page · Terminology and language guide.
content/lingo/index.adoc - Posts · Short news or status posts.
content/posts - Extra articles · Large collection of companion essays and examples.
content/extra - Embedded examples · Scripts, notebooks, binaries, and diagrams tied to article explanations.
content/extra/classic-coroutines
Theme boundary
Upstream Cupper theme and local presentation overrides.
- Cupper theme · Upstream theme providing shared layouts, assets, shortcodes, and example site.
themes/cupper - Local layouts · Repository-specific presentation overrides layered on the theme.
layouts - Theme layouts · Base templates, partials, and shortcodes from the theme.
themes/cupper/layouts - Theme assets · Theme-provided styling and client scripts.
themes/cupper/assets
Static delivery
Published assets and structured data served with the generated site.
- Static assets · Images, manifest, and other files copied directly into the built site.
static - Flags data · Country and flag metadata store supporting emoji and flags pages.
static/data/flags - Theme static · Theme-level images, prism styling, and service-worker registration.
themes/cupper/static
Build and deploy
Tooling and hosting configuration for static generation and publication.
- Hugo build · Renders content through theme templates into static HTML.
- AsciiDoctor · External conversion step for AsciiDoc content during the build.
Gemfile - Netlify deploy · Static hosting and CI deployment target.
netlify.toml - Maintenance helpers · Small repository utilities for deployment and content fixes.
Other components
- Fluent Python site · Static documentation site for fluentpython.com.
Connections 24
- Fluent Python site → Content tree: sources · The site is authored in the content tree.
- Fluent Python site → Cupper theme: uses · The site is built on the Cupper theme.
- Fluent Python site → Static assets: publishes · Static files are shipped with the generated site.
- Content tree → Home page: contains · Top-level landing content.
- Content tree → About page: contains · About page content.
- Content tree → Lingo page: contains · Glossary and terminology content.
- Content tree → Posts: contains · Posts section.
- Content tree → Extra articles: contains · Topic-focused companion articles.
- Extra articles → Embedded examples: embeds · Articles bundle code, notebooks, diagrams, and reference files.
- Extra articles → AsciiDoctor: renders via · Some extra articles are authored in AsciiDoc.
- Hugo build → Theme layouts: renders with · Hugo uses theme templates and partials.
- Hugo build → Local layouts: overrides with · Repository-specific templates extend the theme.
- Hugo build → Content tree: builds · Hugo compiles editorial source into the site.
- Hugo build → Static assets: copies · Static assets are included verbatim.
- Hugo build → Theme assets: includes · Theme CSS and JavaScript are part of presentation.
- Hugo build → AsciiDoctor: invokes · AsciiDoc files are converted during the site build.
- Flags data → Extra articles: supports · Structured flag metadata powers emoji/flags pages.
- Cupper theme → Theme layouts: provides · Base rendering system from the theme.
- Cupper theme → Theme assets: provides · Theme-level styles and scripts.
- Cupper theme → Theme static: provides · Theme static files shipped with the site.
- Netlify deploy → Hugo build: runs · Deployment triggers the Hugo build.
- Netlify deploy → Fluent Python site: hosts · Publishes the generated static site.
- Maintenance helpers → Netlify deploy: assists · Deployment helper scripts support hosting workflows.
- Maintenance helpers → Hugo build: assists · Utility scripts support repository maintenance around the build.