init: examples and simple readme
Changes
| .gitignore | +2 -0 | |
| README.md | +26 -0 | |
| content/01-markdown-basics.md | +147 -0 | |
| content/02-html-in-markdown.md | +120 -0 | |
| content/03-css-tricks.md | +109 -0 | |
| content/04-shortcodes.md | +66 -0 | |
| content/05-markdown-config.md | +77 -0 | |
| content/_index.md | +4 -0 | |
| content/about/_index.md | +4 -0 | |
| content/projects/1.md | +5 -0 | |
| content/projects/_index.md | +4 -0 | |
| static/diagrams/architecture.svg | +22 -0 | |
| static/images/placeholder-wide.svg | +4 -0 | |
| static/images/placeholder.svg | +4 -0 | |
| themes/plc/README.md | +683 -0 | |
| themes/plc/sass/print.scss | +44 -0 | |
| themes/plc/sass/style.scss | +301 -0 | |
| themes/plc/templates/404.html | +8 -0 | |
| themes/plc/templates/base.html | +32 -0 | |
| themes/plc/templates/index.html | +17 -0 | |
| themes/plc/templates/page.html | +50 -0 | |
| themes/plc/templates/section.html | +18 -0 | |
| themes/plc/templates/tags/list.html | +12 -0 | |
| themes/plc/templates/tags/single.html | +17 -0 | |
| themes/plc/theme.toml | +11 -0 | |
| zola.toml | +37 -0 |
26 files changed, 1824 insertions, 0 deletions
Diff
.gitignore @@ -0,0 +1,2 @@ +# ignore `zola build` output +public/ README.md @@ -0,0 +1,26 @@ +See examples in: +``` +content +├── 01-markdown-basics.md +├── 02-html-in-markdown.md +├── 03-css-tricks.md +├── 04-shortcodes.md +└── 05-markdown-config.md +``` + + +[About](content/about/_index.md) is meant to be simple title and body page. + +[Projects](content/projects/_index.md) is simple title page with body and project 'articles'. + +They both use [section.html](themes/plc/templates/section.html) as template so both support having title, body and articles just like the homepage. + +Footer is defined in [zola.toml](zola.toml) + +``` +plc_menu = [ + { text = "tags", link = "tags" }, + { text = "about", link = "about" }, + { text = "projects", link = "projects" }, +] +``` content/01-markdown-basics.md @@ -0,0 +1,147 @@ ++++ +title = "Markdown basics" +description = "CommonMark and Zola markdown extras in one working example." +date = 2026-03-10 +[taxonomies] +tags = ["howto"] ++++ + +## Headings + +Headings from `##` to `####` — Zola uses `#` for the page title automatically. + +### Third-level heading + +#### Fourth-level heading + +--- + +## Text formatting + +This is **bold text**, this is *italic text*, and this is ***bold italic***. + +Here is ~~strikethrough text~~ using double tildes. + +Here is `inline code` using backticks. + +--- + +## Links + +Inline link: [Zola documentation](https://www.getzola.org/documentation/) + +Reference-style link: [CommonMark spec][commonmark] + +Autolink: <https://www.getzola.org/> + +[commonmark]: https://spec.commonmark.org/0.31.2/ + +--- + +## Lists + +### Unordered + +- First item +- Second item + - Nested item + - Another nested item +- Third item + +### Ordered + +1. First step +2. Second step + 1. Sub-step A + 2. Sub-step B +3. Third step + +### Task list + +- [x] Install Zola +- [x] Choose a theme +- [ ] Write first post +- [ ] Deploy + +--- + +## Blockquotes + +> A single-line blockquote. + +> A multi-paragraph blockquote. +> +> Second paragraph still inside the quote. + +> Nested blockquotes: +> +> > Inner quote sits one level deeper. + +--- + +## Code blocks + +Fenced code block with a language tag: + +```rust +fn main() { + println!("Hello from Zola!"); +} +``` + +```toml +[markdown] +smart_punctuation = true +``` + +```html +<details> + <summary>Click me</summary> + Hidden content. +</details> +``` + +Plain code block (no language): + +``` +Just plain preformatted text. +``` + +--- + +## Tables + +| Feature | Supported | Notes | +|:-----------------|:---------:|-------------------:| +| Tables | yes | With alignment | +| Footnotes | yes | `[^1]` syntax | +| Strikethrough | yes | `~~text~~` | +| Task lists | yes | `- [x]` / `- [ ]` | + +Left-aligned, center-aligned, and right-aligned columns shown above. + +--- + +## Footnotes + +Zola supports footnotes[^1] using reference-style syntax[^2]. + +[^1]: This is the first footnote, rendered at the bottom of the page when `bottom_footnotes = true`. + +[^2]: Footnotes can contain **formatting** and `code`. + +--- + +## Horizontal rules + +Three dashes, asterisks, or underscores each produce a horizontal rule. The ones separating sections on this page are `---`. + +--- + +## Images + +Standard markdown image: + + + +To add a caption, use `<figure>` — see the HTML-in-markdown example. content/02-html-in-markdown.md @@ -0,0 +1,120 @@ ++++ +title = "HTML in markdown" +description = "Raw HTML patterns that work in Zola posts — figures, video, audio, details, embeds, semantic elements, and more." +date = 2026-03-11 +[taxonomies] +tags = ["howto"] ++++ + +Because Zola renders content with `{{ page.content | safe }}`, any HTML you write in markdown is output as-is. This page demonstrates every pattern from the theme README. + +## Figure with caption + +<figure> + <img src="/images/placeholder.svg" alt="A placeholder image"> + <figcaption>Figure 1 — a placeholder SVG used for demonstration.</figcaption> +</figure> + +--- + +## Video + +Self-hosted video from `static/`. Replace the path with your own file. + +<video controls> + <!-- Place your video file in static/videos/ and update the path below --> + <source src="/videos/demo.mp4" type="video/mp4"> + Your browser does not support the video element. +</video> + +--- + +## Audio + +Self-hosted audio. Replace the path with your own file. + +<audio controls> + <!-- Place your audio file in static/audio/ and update the path below --> + <source src="/audio/track.mp3" type="audio/mpeg"> + Your browser does not support the audio element. +</audio> + +--- + +## Collapsible sections + +### Collapsed by default + +<details> + <summary>Click to expand</summary> + + Hidden content here. Markdown works inside if you leave blank lines around it. + + - Item one + - Item two + +</details> + +### Expanded by default + +<details open> + <summary>Already expanded</summary> + + This content is visible on page load. The `open` attribute controls this. + +</details> + +--- + +## Embedded content (iframe) + +YouTube embed using the privacy-enhanced URL. Replace `VIDEO_ID` with an actual video ID. + +<iframe width="560" height="315" + src="https://www.youtube-nocookie.com/embed/VIDEO_ID" + frameborder="0" allowfullscreen> +</iframe> + +--- + +## Inline SVG reference + +Reference an SVG file from `static/`: + +<img src="/diagrams/architecture.svg" alt="System architecture diagram"> + +--- + +## Semantic elements + +### Keyboard input + +Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to save. + +### Highlighted text + +This is <mark>highlighted text</mark> using the `<mark>` element. + +### Abbreviation + +<abbr title="HyperText Markup Language">HTML</abbr> is the backbone of the web. + +### Machine-readable date + +Published on <time datetime="2024-06-01">June 1, 2024</time>. + +### Sample output + +The compiler returned: <samp>Error: file not found</samp> + +--- + +## Visual indicators + +### Meter + +Disk usage: <meter value="0.7" min="0" max="1" low="0.3" high="0.7" optimum="0.5">70%</meter> + +### Progress bar + +Build progress: <progress value="75" max="100">75%</progress> content/03-css-tricks.md @@ -0,0 +1,109 @@ ++++ +title = "CSS tricks" +description = "CSS-only interactivity — toggles, anchor navigation, hover effects, animations, and responsive images — no JavaScript required." +date = 2026-03-12 +[taxonomies] +tags = ["howto"] ++++ + +Since this theme ships zero JavaScript, CSS is the tool for interactivity. Everything below works in any modern browser with no scripts. + +## CSS-only toggle (checkbox hack) + +A hidden checkbox, a `<label>`, and the `:checked` selector: + +<style> + .toggle-content { display: none; } + #toggle:checked ~ .toggle-content { display: block; } +</style> + +<input type="checkbox" id="toggle" hidden> +<label for="toggle" style="cursor:pointer; text-decoration:underline;">Show / hide content</label> +<div class="toggle-content"> + +This paragraph appears when the label is clicked. +No JavaScript — just CSS `:checked`. + +</div> + +--- + +## Anchor navigation (:target) + +The `:target` pseudo-class styles the element whose `id` matches the current URL fragment. Click the links below to switch panels. + +<style> + .panel { display: none; padding: 1em; margin-top: 0.5em; } + .panel:target { display: block; } +</style> + +<a href="#tab1">Tab 1</a> | <a href="#tab2">Tab 2</a> | <a href="#tab3">Tab 3</a> + +<div id="tab1" class="panel"> + +**First panel** — this is the content for Tab 1. + +</div> + +<div id="tab2" class="panel"> + +**Second panel** — content for Tab 2 goes here. + +</div> + +<div id="tab3" class="panel"> + +**Third panel** — and this is Tab 3. + +</div> + +--- + +## Hover effect with CSS transition + +<style> + .card { + padding: 1em; + border: 1px solid currentColor; + transition: transform 0.2s ease; + display: inline-block; + } + .card:hover { + transform: scale(1.05); + } +</style> + +<div class="card"> + Hover over this card to see it scale up slightly. +</div> + +--- + +## CSS animation (@keyframes) + +<style> + @keyframes pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.4; } + } + .blink { + animation: pulse 2s infinite; + font-weight: bold; + } +</style> + +Status: <span class="blink">LIVE</span> + +--- + +## Responsive images with `<picture>` + +The `<picture>` element lets the browser choose a source based on media queries: + +<picture> + <source srcset="/images/placeholder.svg" media="(max-width: 600px)"> + <source srcset="/images/placeholder-wide.svg"> + <img src="/images/placeholder-wide.svg" alt="Responsive placeholder image"> +</picture> + +Resize the browser window to see the image switch between the narrow and wide variants. content/04-shortcodes.md @@ -0,0 +1,66 @@ ++++ +title = "Shortcodes" +description = "What Zola shortcodes are, how they work, and how to create your own." +date = 2026-03-13 +[taxonomies] +tags = ["howto"] ++++ + +Shortcodes are reusable HTML templates you invoke from markdown. Zola looks for them in `templates/shortcodes/` — either in your site root or in the theme. + +## Inline vs block syntax + +**Inline** shortcodes render in place: + +``` +{{/* shortcode_name(arg="value") */}} +``` + +**Block** shortcodes wrap content: + +``` +{%/* shortcode_name() */%} +Content goes here +{%/* end */%} +``` + +## Example: video shortcode + +### The template + +Create `templates/shortcodes/video.html`: + +```html +<video controls {% if autoplay %}autoplay muted loop{% endif %}> + <source src="{{ src }}" type="video/mp4"> +</video> +``` + +### Usage in markdown + +``` +{{/* video(src="/videos/demo.mp4") */}} +{{/* video(src="/videos/bg-loop.mp4", autoplay=true) */}} +``` + +The first call renders a standard video player with controls. The second adds `autoplay muted loop` for a silent background loop. + +## Creating your own shortcodes + +1. Create a file in `templates/shortcodes/` — the filename (minus `.html`) becomes the shortcode name +2. Use Tera template syntax for parameters +3. Call it from any markdown file using `{{ name(args) }}` or `{%/* name() */%}...{%/* end */%}` + +## Note on rendering + +Shortcode calls in this example file will **not** render unless the corresponding template files exist in `templates/shortcodes/`. The syntax above is shown as code blocks so you can see the raw invocation. + +To test shortcodes: + +1. Create the template file (e.g. `templates/shortcodes/video.html`) +2. Use the shortcode syntax (without the code block) in a content page +3. Run `zola serve` to see the result + +## Further reading + +See the [Zola shortcodes documentation](https://www.getzola.org/documentation/content/shortcodes/) for the full reference, including body content, optional arguments, and built-in shortcodes. content/05-markdown-config.md @@ -0,0 +1,77 @@ ++++ +title = "Markdown configuration" +description = "Complete reference for Zola's [markdown] and [markdown.highlighting] settings in zola.toml." +date = 2026-03-14 +[taxonomies] +tags = ["howto"] ++++ + +## Recommended settings + +Add these to your `zola.toml` for a good default experience: + +```toml +[markdown] +smart_punctuation = true # "quotes" -> curly quotes, -- -> en-dash, --- -> em-dash +bottom_footnotes = true # Footnotes render at the page bottom (GitHub-style) +lazy_async_image = true # Adds loading="lazy" and decoding="async" to images +``` + +--- + +## Complete `[markdown]` reference + +All options and their defaults: + +| Option | Type | Default | Description | +|---|---|---|---| +| `render_emoji` | bool | `false` | Convert `:emoji:` codes to Unicode characters | +| `external_links_target_blank` | bool | `false` | Open external links in a new tab | +| `external_links_no_follow` | bool | `false` | Add `rel="nofollow"` to external links | +| `external_links_no_referrer` | bool | `false` | Add `rel="noreferrer"` to external links | +| `external_links_external` | bool | `true` | Add `rel="external"` to external links | +| `external_links_class` | string | `""` | CSS class added to external links | +| `smart_punctuation` | bool | `false` | Typographic quotes, en-dashes, em-dashes | +| `definition_list` | bool | `false` | Enable `term` / `: definition` syntax | +| `lazy_async_image` | bool | `false` | Add `loading="lazy"` and `decoding="async"` to `<img>` | +| `bottom_footnotes` | bool | `false` | Render footnotes at page bottom | +| `github_alerts` | bool | `false` | Enable `> [!NOTE]` / `> [!WARNING]` callout syntax | +| `insert_anchor_links` | string | `"none"` | Add anchor links to headers: `"left"`, `"right"`, `"heading"`, or `"none"` | + +--- + +## Complete `[markdown.highlighting]` reference + +| Option | Type | Default | Description | +|---|---|---|---| +| `theme` | string | `"base16-ocean-dark"` | Syntax highlight theme name | +| `style` | string | *(none)* | Choose `"class"` for CSS-based or omit for inline styles | +| `light_theme` | string | *(none)* | Separate theme for light mode (requires `style = "class"`) | +| `dark_theme` | string | *(none)* | Separate theme for dark mode (requires `style = "class"`) | +| `error_on_missing_language` | bool | `false` | Fail the build if a code block specifies an unknown language | +| `extra_grammars` | list | `[]` | Paths to additional `.sublime-syntax` grammar files | +| `extra_themes` | list | `[]` | Paths to additional `.tmTheme` theme files | + +Browse available themes at [textmate-grammars-themes.netlify.app](https://textmate-grammars-themes.netlify.app/). + +--- + +## Highlighting theme example + +To switch themes, change the `theme` value: + +```toml +[markdown.highlighting] +theme = "monokai" +``` + +For separate light/dark themes using CSS classes: + +```toml +[markdown.highlighting] +style = "class" +light_theme = "OneHalfLight" +dark_theme = "OneHalfDark" +``` + +With `style = "class"`, Zola generates CSS class names instead of inline styles, and applies the appropriate theme based on the user's color scheme preference. content/_index.md @@ -0,0 +1,4 @@ ++++ +title = "examples" +sort_by = "permalink" ++++ content/about/_index.md @@ -0,0 +1,4 @@ ++++ +title = "About" ++++ +About this and that content/projects/1.md @@ -0,0 +1,5 @@ ++++ +title="Project #1" +date=2077-04-20 ++++ +Super cool project #1 content/projects/_index.md @@ -0,0 +1,4 @@ ++++ +title='Projects' ++++ +Only cool projects here. static/diagrams/architecture.svg @@ -0,0 +1,22 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="400" height="250" viewBox="0 0 400 250"> + <defs> + <marker id="arrow" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto"> + <polygon points="0 0, 10 3.5, 0 7" fill="rgba(255,255,255,0.75)"/> + </marker> + </defs> + <rect width="400" height="250" fill="#39424E"/> + <rect x="10" y="10" width="120" height="50" rx="5" fill="none" stroke="rgba(255,255,255,0.75)" stroke-width="2"/> + <text x="70" y="40" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="12">Browser</text> + <rect x="270" y="10" width="120" height="50" rx="5" fill="none" stroke="rgba(255,255,255,0.75)" stroke-width="2"/> + <text x="330" y="40" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="12">Static Files</text> + <line x1="270" y1="35" x2="130" y2="35" stroke="rgba(255,255,255,0.75)" stroke-width="2" marker-end="url(#arrow)"/> + <rect x="140" y="100" width="120" height="50" rx="5" fill="none" stroke="rgba(255,255,255,0.75)" stroke-width="2"/> + <text x="200" y="130" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="12">Zola (build)</text> + <rect x="10" y="190" width="120" height="50" rx="5" fill="none" stroke="rgba(255,255,255,0.75)" stroke-width="2"/> + <text x="70" y="220" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="12">content/</text> + <rect x="270" y="190" width="120" height="50" rx="5" fill="none" stroke="rgba(255,255,255,0.75)" stroke-width="2"/> + <text x="330" y="220" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="12">templates/</text> + <line x1="70" y1="190" x2="170" y2="150" stroke="rgba(255,255,255,0.75)" stroke-width="2" marker-end="url(#arrow)"/> + <line x1="330" y1="190" x2="230" y2="150" stroke="rgba(255,255,255,0.75)" stroke-width="2" marker-end="url(#arrow)"/> + <line x1="200" y1="100" x2="330" y2="60" stroke="rgba(255,255,255,0.75)" stroke-width="2" marker-end="url(#arrow)"/> +</svg> static/images/placeholder-wide.svg @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="800" height="200" viewBox="0 0 800 200"> + <rect width="800" height="200" fill="#39424E"/> + <text x="400" y="105" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="16">placeholder wide image</text> +</svg> static/images/placeholder.svg @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200" viewBox="0 0 300 200"> + <rect width="300" height="200" fill="#39424E"/> + <text x="150" y="105" text-anchor="middle" fill="rgba(255,255,255,0.75)" font-family="sans-serif" font-size="16">placeholder image</text> +</svg> themes/plc/README.md @@ -0,0 +1,683 @@ +# plc + +A zero-JavaScript Zola theme with semantic HTML5. + +**Core principles:** absolute minimalism, zero JavaScript, maximum HTML cleanliness. + +- **Zero CSS classes** — styles target semantic HTML elements only (the sole exception is `.skip-link` for accessibility) +- **Zero JavaScript** — no scripts, no search index, nothing +- **System font stacks** — no font files to download +- **Validates** with [Nu HTML Checker (vnu)](https://validator.github.io/validator/) + +## Installation + +```sh +git submodule add https://codeberg.com/user/plc.git themes/plc +``` + +Set in `zola.toml`: + +```toml +theme = "plc" +``` + +Minimum Zola version: **0.19.0** + +## Full `zola.toml` configuration reference + +```toml +# Site +base_url = "https://example.com" +theme = "plc" +title = "blog" + +# Required — the theme uses SCSS +compile_sass = true + +# RSS feed +generate_feeds = true +feed_filenames = ["rss.xml"] + +# The theme has no JS, so search won't work — keep this false +build_search_index = false + +# Tags with per-tag RSS +taxonomies = [ + { name = "tags", rss = true }, +] + +# Syntax highlighting +# Pick a theme: https://textmate-grammars-themes.netlify.app/ +[markdown.highlighting] +theme = "monokai" + +[extra] +# Footer navigation links (rendered in order, before the home link) +plc_menu = [ + { text = "tags", link = "tags" }, + { text = "about", link = "about" }, +] + +# Text for the home link in the footer (default: "home") +home = "home" + +# strftime format for dates (default: "%y.%m.%d") +date_format = "%y.%m.%d" +``` + +## Creating pages + +Each `link` value in `plc_menu` corresponds to a Zola page or section at that URL path. Here's how to create the content behind those links. + +### Standalone page (e.g. `/about`) + +Create `content/about/_index.md`: + +```toml ++++ +title = "About" ++++ + +Write your about page content here in Markdown. +``` + +This creates a **section** at `/about` rendered with `section.html`. Using `_index.md` inside a folder keeps the page separate from your blog posts — it won't appear in the main post listing. + +> **Why not `content/about.md`?** A plain `.md` file in `content/` is treated as a regular page and shows up alongside your blog posts on the homepage. Using `content/about/_index.md` makes it an independent section. + +### Section with sub-pages (e.g. `/projects`) + +Create `content/projects/_index.md`: + +```toml ++++ +title = "Projects" +sort_by = "date" ++++ +``` + +Then add child pages as files inside the folder, e.g. `content/projects/my-project.md`: + +```toml ++++ +title = "My cool project" +description = "A short summary of the project." +date = 2024-06-01 ++++ + +Project details in Markdown. +``` + +Zola renders the section index with `section.html` (lists all child pages) and each child with `page.html`. Only `title` is required in child pages — `date` and `description` are optional but useful (dates control sort order when `sort_by = "date"`, descriptions appear below the title on the page). + +### Tags page (`/tags`) + +The `/tags` link works automatically when taxonomies are configured in `zola.toml`: + +```toml +taxonomies = [ + { name = "tags", rss = true }, +] +``` + +Zola generates the tag listing and per-tag pages — no content files needed. + +## Page frontmatter reference + +All fields between `+++` at the top of a `.md` file. + +| Field | Type | Required | Description | +|---|---|---|---| +| `title` | string | yes | Page title — used in `<title>` and `<h1>` | +| `description` | string | no | Renders as `<meta name="description">` and displayed below article metadata | +| `date` | YYYY-MM-DD | no | Publication date, formatted per `date_format` | +| `[taxonomies]` | table | no | e.g. `tags = ["howto", "music"]` | +| `template` | string | no | Override the default template | +| `sort_by` | string | no | For sections: `"date"`, `"title"`, etc. | + +### Example page frontmatter + +```toml ++++ +title = "How was this made" +description = "Setting up a static blog with Zola." +date = 2023-07-13 +[taxonomies] +tags = ["howto"] ++++ +``` + +### Example section `_index.md` + +```toml ++++ +title = "Articles" +sort_by = "date" ++++ +``` + +## Writing content + +Markdown in Zola follows the [CommonMark 0.31.2 spec](https://spec.commonmark.org/0.31.2/) — headings, bold, italic, links, images, lists, code blocks, and blockquotes all work as expected. + +### Zola markdown extras + +These work out of the box beyond CommonMark: + +| Feature | Syntax | +|---|---| +| Tables | `\| col \| col \|` with header separator | +| Footnotes | `[^1]` reference + `[^1]: text` definition | +| Strikethrough | `~~deleted text~~` | +| Task lists | `- [x] done` / `- [ ] not done` | + +### Raw HTML + +Because templates render content with `{{ page.content | safe }}`, any HTML tag in your markdown is rendered as-is. This opens up everything below. + +### Images + +Standard markdown: + +```md + +``` + +With caption using `<figure>`: + +```html +<figure> + <img src="sunset.jpg" alt="A sunset over the mountains"> + <figcaption>Sunset over the mountains, June 2024</figcaption> +</figure> +``` + +### Video + +Self-hosted from `static/`: + +```html +<video controls> + <source src="/videos/demo.mp4" type="video/mp4"> +</video> +``` + +### Audio + +```html +<audio controls> + <source src="/audio/track.mp3" type="audio/mpeg"> +</audio> +``` + +### GIFs + +Just use markdown images or `<img>`: + +```md + +``` + +### Collapsible sections + +The theme already uses `<details>`/`<summary>` for the table of contents — you can use the same pattern in your content: + +```html +<details> + <summary>Click to expand</summary> + Hidden content here. Markdown works inside if you leave blank lines + around it. +</details> +``` + +### Embedded content + +```html +<iframe width="560" height="315" + src="https://www.youtube-nocookie.com/embed/VIDEO_ID" + frameborder="0" allowfullscreen> +</iframe> +``` + +Works for YouTube, OpenStreetMap, and anything else that provides embed URLs. + +### Inline SVG + +Paste SVG code directly into your markdown, or reference a file: + +```html +<img src="/diagrams/architecture.svg" alt="System architecture diagram"> +``` + +### Semantic elements + +```html +Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to save. + +This is <mark>highlighted text</mark>. + +<abbr title="HyperText Markup Language">HTML</abbr> is the backbone of the web. + +Published on <time datetime="2024-06-01">June 1, 2024</time>. +``` + +> **Try it:** open [`examples/01-markdown-basics.md`](examples/01-markdown-basics.md) for all CommonMark + Zola extras in one working file, and [`examples/02-html-in-markdown.md`](examples/02-html-in-markdown.md) for every raw HTML pattern above. + +## Beyond markdown — HTML5 without JavaScript + +Since this theme renders raw HTML and ships zero JavaScript, you can use the full power of HTML5 and CSS directly in your posts. Here's a comprehensive reference of what's possible. + +### Media + +**Video** with full attributes: + +```html +<video controls poster="/images/thumbnail.jpg"> + <source src="/videos/demo.webm" type="video/webm"> + <source src="/videos/demo.mp4" type="video/mp4"> +</video> +``` + +Add `autoplay muted loop` for silent background loops, `poster` for a preview frame. + +**Responsive images** with `<picture>`: + +```html +<picture> + <source srcset="/images/hero-800.webp" media="(max-width: 800px)"> + <source srcset="/images/hero-1200.webp"> + <img src="/images/hero-1200.jpg" alt="Hero image"> +</picture> +``` + +**Audio** supports multiple formats the same way `<video>` does. + +### Interactive elements + +**Collapsible sections** — add the `open` attribute to start expanded: + +```html +<details open> + <summary>Expanded by default</summary> + This content is visible on page load. +</details> +``` + +**CSS-only toggles** — the checkbox hack uses a hidden `<input>`, a `<label>`, and the `:checked` selector: + +```html +<style> + .toggle-content { display: none; } + #toggle:checked ~ .toggle-content { display: block; } +</style> + +<input type="checkbox" id="toggle" hidden> +<label for="toggle">Show/hide content</label> +<div class="toggle-content"> + This appears when the label is clicked. +</div> +``` + +### Visual indicators + +**Meter** — displays a value within a known range: + +```html +<meter value="0.7" min="0" max="1" low="0.3" high="0.7" optimum="1">70%</meter> +``` + +**Progress bar** — static progress indicator: + +```html +<progress value="75" max="100">75%</progress> +``` + +### Semantic markup + +| Element | Purpose | Example | +|---|---|---| +| `<figure>` + `<figcaption>` | Captioned media | Images, code blocks, quotes | +| `<mark>` | Highlighted text | Search results, emphasis | +| `<abbr title="...">` | Abbreviation with tooltip | `<abbr title="CSS">CSS</abbr>` | +| `<kbd>` | Keyboard input | `<kbd>Ctrl</kbd>+<kbd>C</kbd>` | +| `<samp>` | Sample program output | `<samp>Error: not found</samp>` | +| `<time datetime="...">` | Machine-readable date | `<time datetime="2024-06-01">June 1</time>` | + +### Embeds + +- **YouTube/video**: `<iframe>` with `youtube-nocookie.com` for privacy +- **Maps**: `<iframe>` with OpenStreetMap embed URL +- **SVG**: inline `<svg>` for full CSS control, or `<img src="file.svg">` for simple display +- **PDFs**: `<object data="file.pdf" type="application/pdf">` with fallback link + +### CSS-only interactivity + +**Hover effects** — add transitions directly in a `<style>` block: + +```html +<style> + .card { transition: transform 0.2s; } + .card:hover { transform: scale(1.02); } +</style> +``` + +**Anchor navigation** — the `:target` pseudo-class styles the element matching the URL fragment: + +```html +<style> + .panel { display: none; } + .panel:target { display: block; } +</style> + +<a href="#tab1">Tab 1</a> | <a href="#tab2">Tab 2</a> +<div id="tab1" class="panel">First panel content</div> +<div id="tab2" class="panel">Second panel content</div> +``` + +**CSS animations** — `@keyframes` work anywhere: + +```html +<style> + @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } + .blink { animation: pulse 2s infinite; } +</style> +<span class="blink">Live</span> +``` + +### Element support summary + +| Category | Elements | Works? | +|---|---|---| +| Media | `<video>`, `<audio>`, `<picture>`, `<img>` (GIF) | ✅ | +| Interactive | `<details>`/`<summary>`, checkbox hack | ✅ | +| Indicators | `<meter>`, `<progress>` | ✅ | +| Semantic | `<figure>`, `<mark>`, `<abbr>`, `<kbd>`, `<samp>`, `<time>` | ✅ | +| Embeds | `<iframe>`, `<svg>`, `<object>` | ✅ | +| CSS effects | `:hover`, `:target`, `@keyframes` | ✅ | + +No JavaScript doesn't mean no interactivity — HTML5 and CSS give you collapsible sections, tabbed content, animations, responsive media, and visual indicators, all with zero JS. + +> **Try it:** open [`examples/03-css-tricks.md`](examples/03-css-tricks.md) for working CSS-only toggles, anchor navigation, hover effects, and animations. + +## Shortcodes + +Shortcodes are reusable HTML templates you invoke from markdown. Zola looks for them in `templates/shortcodes/` — either in your site root or in the theme. + +### Syntax + +Inline (renders in place): + +``` +{{ shortcode_name(arg="value") }} +``` + +Block (wraps content): + +``` +{% shortcode_name() %} +Content goes here +{% end %} +``` + +### Example: video shortcode + +Create `templates/shortcodes/video.html`: + +```html +<video controls {% if autoplay %}autoplay muted loop{% endif %}> + <source src="{{ src }}" type="video/mp4"> +</video> +``` + +Use it in any markdown file: + +``` +{{ video(src="/videos/demo.mp4") }} +{{ video(src="/videos/bg-loop.mp4", autoplay=true) }} +``` + +See [Zola shortcodes documentation](https://www.getzola.org/documentation/content/shortcodes/) for the full reference. + +> **Try it:** open [`examples/04-shortcodes.md`](examples/04-shortcodes.md) for a working page explaining shortcode syntax and a video shortcode example. + +## Markdown configuration + +### Useful options + +These are worth enabling for most blogs. Add to `zola.toml`: + +```toml +[markdown] +smart_punctuation = true # "quotes" → "quotes", -- → –, --- → — +bottom_footnotes = true # Footnotes render at the page bottom (GitHub-style) +lazy_async_image = true # Adds loading="lazy" and decoding="async" to images +``` + +### Complete `[markdown]` reference + +| Option | Type | Default | Description | +|---|---|---|---| +| `render_emoji` | bool | `false` | Convert `:emoji:` codes to Unicode characters | +| `external_links_target_blank` | bool | `false` | Open external links in a new tab | +| `external_links_no_follow` | bool | `false` | Add `rel="nofollow"` to external links | +| `external_links_no_referrer` | bool | `false` | Add `rel="noreferrer"` to external links | +| `external_links_external` | bool | `true` | Add `rel="external"` to external links | +| `external_links_class` | string | `""` | CSS class added to external links | +| `smart_punctuation` | bool | `false` | Typographic quotes, en-dashes, em-dashes | +| `definition_list` | bool | `false` | Enable `term\n: definition` syntax | +| `lazy_async_image` | bool | `false` | Add `loading="lazy"` and `decoding="async"` to `<img>` | +| `bottom_footnotes` | bool | `false` | Render footnotes at page bottom | +| `github_alerts` | bool | `false` | Enable `> [!NOTE]` / `> [!WARNING]` callout syntax | +| `insert_anchor_links` | string | `"none"` | Add anchor links to headers: `"left"`, `"right"`, `"heading"`, or `"none"` | + +### Complete `[markdown.highlighting]` reference + +| Option | Type | Default | Description | +|---|---|---|---| +| `theme` | string | `"base16-ocean-dark"` | Syntax highlight theme name | +| `style` | string | *(none)* | Choose `"class"` for CSS-based or omit for inline styles | +| `light_theme` | string | *(none)* | Separate theme for light mode (requires `style = "class"`) | +| `dark_theme` | string | *(none)* | Separate theme for dark mode (requires `style = "class"`) | +| `error_on_missing_language` | bool | `false` | Fail the build if a code block specifies an unknown language | +| `extra_grammars` | list | `[]` | Paths to additional `.sublime-syntax` grammar files | +| `extra_themes` | list | `[]` | Paths to additional `.tmTheme` theme files | + +Browse available themes at [textmate-grammars-themes.netlify.app](https://textmate-grammars-themes.netlify.app/). + +> **Try it:** open [`examples/05-markdown-config.md`](examples/05-markdown-config.md) for a single-page TOML reference with all `[markdown]` and `[markdown.highlighting]` options. + +## Dark mode / Light mode + +The theme respects the user's OS/browser preference automatically via CSS — no toggle, no JavaScript. + +- **Dark mode** is the default (`:root` block in `style.scss`) +- **Light mode** overrides are in `@media (prefers-color-scheme: light)` + +### CSS custom properties per mode + +| Variable | Dark | Light | +|---|---|---| +| `--bg` | `#39424E` | `#f5f5f0` | +| `--text` | `rgba(255, 255, 255, 0.75)` | `rgba(0, 0, 0, 0.75)` | +| `--text-heading` | `rgba(255, 255, 255, 1.0)` | `#1a1a1a` | +| `--text-meta` | `rgba(255, 255, 255, 0.55)` | `rgba(0, 0, 0, 0.5)` | +| `--link` | `rgba(255, 255, 255, 0.8)` | `#2a5a8a` | +| `--link-hover` | `#fff` | `#1a3a5a` | +| `--border` | `rgba(255, 255, 255, 0.3)` | `rgba(0, 0, 0, 0.2)` | +| `--code-bg` | `#000004` | *(inherits dark value)* | +| `--code-inline-bg` | `rgba(0, 0, 0, 0.3)` | `rgba(0, 0, 0, 0.06)` | +| `--code-inline-border` | `rgba(255, 255, 255, 0.2)` | `rgba(0, 0, 0, 0.12)` | +| `--blockquote-bg` | `rgba(0, 0, 0, 0.15)` | `rgba(0, 0, 0, 0.04)` | +| `--table-header-bg` | `rgba(0, 0, 0, 0.2)` | `rgba(0, 0, 0, 0.06)` | + +### Disabling automatic switching + +**Hardcode dark mode only** — remove the entire `@media (prefers-color-scheme: light) { ... }` block from `style.scss`. + +**Hardcode light mode only** — copy the light-mode variable values into `:root` and remove the `@media` block. + +## RSS + +- Enabled by `generate_feeds = true` and `feed_filenames = ["rss.xml"]` in `zola.toml` +- A `<link rel="alternate" type="application/rss+xml">` tag is automatically added to `<head>` when feeds are enabled +- Per-tag RSS is enabled by `{ name = "tags", rss = true }` in the taxonomies array +- No JavaScript required — standard RSS XML + +## Print stylesheet + +Loaded via `<link rel="stylesheet" href="print.css" media="print">` — only activated when the browser triggers print (Ctrl+P or `window.print()`). + +What it does: + +- Black text on white background +- Hides nav, footer, table of contents, and skip-link +- Appends URLs after external links (e.g. "Example (https://example.com)") +- Prevents page breaks after headings and inside images +- Wraps long code blocks instead of overflowing +- `@page { margin: 2cm }` + +## Skip to content + +An `<a href="#main" class="skip-link">Skip to content</a>` element is the first thing in `<body>`. + +- Visually hidden via `left: -9999px` +- Appears on keyboard Tab focus +- Links to `<main id="main">` which holds all page content +- Purpose: accessibility for keyboard and screen-reader users to bypass the footer nav + +## Table of contents + +Auto-generated from Markdown headings when `page.toc` is non-empty. + +- Renders as a collapsible `<details>/<summary>` inside `<nav aria-label="Table of contents">` +- Supports two levels: `##` headings are top items, `###` headings are nested children +- To use it: just write `## Heading` and `### Subheading` in your Markdown — Zola parses these automatically, no config needed +- Hidden in print mode + +## Fonts + +### SCSS variables + +| Variable | Purpose | Default | +|---|---|---| +| `$font-body` | Body text | `Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif` | +| `$font-code` | Code blocks and inline code | `ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace` | + +Both defaults are **system font stacks** — a comma-separated list of font names. The browser tries each one left-to-right and uses the first one installed on the user's system. This means no font files need downloading; the theme uses whatever the OS already has. + +### Where to find fonts + +- [Modern Font Stacks](https://modernfontstacks.com/) — curated system font stacks that work without downloads, ideal for this theme's zero-download philosophy +- [Bunny Fonts](https://fonts.bunny.net/) — privacy-friendly font library for downloading web fonts to self-host + +### How to change fonts + +#### 1. System font stack swap (no downloads) + +Go to [modernfontstacks.com](https://modernfontstacks.com/), pick a stack you like, and find its `font-family:` CSS line. Copy just the font names (without the `font-family:` prefix and `;` suffix). Paste that as the `$font-body` value in `style.scss`. + +For example, to use the Didone stack: + +```scss +// Before (default): +$font-body: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif; + +// After (Didone stack from modernfontstacks.com): +$font-body: Didot, "Bodoni MT", "Noto Serif Display", "URW Palladio L", P052, Sylfaen, serif; +``` + +#### 2. Self-hosted web font from Bunny Fonts + +For a specific font that isn't in any system stack, you can download it and self-host it. Here's how using Anaheim as an example: + +1. Visit [fonts.bunny.net/family/anaheim](https://fonts.bunny.net/family/anaheim) +2. Download the `.woff2` file (click the download link on the page) +3. Place it in `static/fonts/Anaheim.woff2` +4. Add `@font-face` and update `$font-body` in `style.scss`: + +```scss +@font-face { + font-family: "Anaheim"; + src: url("/fonts/Anaheim.woff2") format("woff2"); +} + +$font-body: "Anaheim", sans-serif; +``` + +The font file is served from your own site — no external requests, no tracking. + +#### 3. Monospace everywhere + +```scss +$font-body: $font-code; +``` + +## Customizing colors and CSS + +All colors are CSS custom properties defined in `:root` (dark) and overridden in `@media (prefers-color-scheme: light)` (light). See the [Dark mode / Light mode](#dark-mode--light-mode) section for the full table. + +| Variable | Purpose | +|---|---| +| `--bg` | Page background | +| `--text` | Body text | +| `--text-heading` | Headings | +| `--text-meta` | Dates, tags, footer | +| `--link` / `--link-hover` | Link colors | +| `--border` | Borders, `<hr>`, table borders | +| `--code-bg` | Code block background | +| `--code-inline-bg` / `--code-inline-border` | Inline code | +| `--blockquote-bg` | Blockquote background | +| `--table-header-bg` | Table header background | + +To customize: edit `themes/plc/sass/style.scss` and change values in `:root` and the light-mode `@media` block. + +SCSS layout variable: `$max-width` (default `800px`) controls the maximum content width. + +Note: `compile_sass = true` must be set in `zola.toml`. + +## Theme structure + +``` +themes/plc/ +├── README.md +├── theme.toml # Theme metadata, min Zola version +├── sass/ +│ ├── style.scss # Main stylesheet (colors, layout, typography) +│ └── print.scss # Print-only stylesheet +└── templates/ + ├── base.html # Base layout: <head>, skip-link, <main>, footer nav + ├── index.html # Homepage: list of pages with dates + ├── section.html # Section listing (same layout as index) + ├── page.html # Single post: title, date, tags, description, TOC, content + ├── 404.html # "Not found" page + └── tags/ + ├── list.html # All tags with post counts + └── single.html # Posts under a single tag +``` + +## HTML validation + +### Via local vnu (podman-compose) + +```yaml +# podman-compose.yml +version: "3" +services: + vnu: + image: ghcr.io/validator/validator:latest + ports: + - "8888:8888" + restart: unless-stopped +``` + +```bash +curl -s -H "Content-Type: text/html; charset=utf-8" \ + --data-binary @public/index.html \ + "http://localhost:8888/?out=gnu" +``` + +### Via Java jar + +```sh +java -jar vnu.jar --errors-only public/**/*.html +``` themes/plc/sass/print.scss @@ -0,0 +1,44 @@ +// Print stylesheet + +@page { + margin: 2cm; +} + +body { + color: #000; + background: #fff; + max-width: none; + padding: 0; +} + +body > nav, +footer, +.skip-link, +article > nav[aria-label="Table of contents"] { + display: none; +} + +a { + color: #000; + border-bottom: none; +} + +a[href^="http"]::after { + content: " (" attr(href) ")"; + font-size: 0.85em; + word-break: break-all; +} + +h1, h2, h3, h4, h5, h6 { + color: #000; + break-after: avoid; +} + +img { + break-inside: avoid; +} + +pre { + white-space: pre-wrap; + border: 1px solid #ccc; +} themes/plc/sass/style.scss @@ -0,0 +1,301 @@ +// plc theme — zero JS, semantic HTML, dark background + +$max-width: 800px; +$font-body: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif; +$font-code: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace; + +:root { + --bg: #39424E; + --text: rgba(255, 255, 255, 0.75); + --text-heading: rgba(255, 255, 255, 1.0); + --text-meta: rgba(255, 255, 255, 0.55); + --link: rgba(255, 255, 255, 0.8); + --link-hover: #fff; + --border: rgba(255, 255, 255, 0.3); + --code-bg: #000004; + --code-inline-bg: rgba(0, 0, 0, 0.3); + --code-inline-border: rgba(255, 255, 255, 0.2); + --blockquote-bg: rgba(0, 0, 0, 0.15); + --table-header-bg: rgba(0, 0, 0, 0.2); +} + +@media (prefers-color-scheme: light) { + :root { + --bg: #f5f5f0; + --text: rgba(0, 0, 0, 0.75); + --text-heading: #1a1a1a; + --text-meta: rgba(0, 0, 0, 0.5); + --link: #2a5a8a; + --link-hover: #1a3a5a; + --border: rgba(0, 0, 0, 0.2); + --code-inline-bg: rgba(0, 0, 0, 0.06); + --code-inline-border: rgba(0, 0, 0, 0.12); + --blockquote-bg: rgba(0, 0, 0, 0.04); + --table-header-bg: rgba(0, 0, 0, 0.06); + } +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + font-family: $font-body; + font-size: 16px; + line-height: 1.6; + color: var(--text); + background: var(--bg); +} + +body { + max-width: $max-width; + margin: 0 auto; + padding: 2rem 1rem; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +main { + flex: 1; +} + +// Skip link + +.skip-link { + position: absolute; + left: -9999px; + top: 0; + background: var(--text-heading); + color: var(--bg); + padding: 0.5em 1em; + z-index: 100; + + &:focus { + left: 0; + } +} + +// Headings + +h1, h2, h3, h4, h5, h6 { + color: var(--text-heading); + line-height: 1.3; + margin: 1.5em 0 0.5em; +} + +h1 { font-size: 1.8rem; } +h2 { font-size: 1.4rem; } +h3 { font-size: 1.2rem; } + +// Links + +a { + color: var(--link); + text-decoration: none; + border-bottom: 1px solid var(--border); + + &:hover { + color: var(--link-hover); + border-bottom-color: var(--link-hover); + } +} + +// Footer + +footer { + margin-top: 3rem; + padding-top: 1rem; + border-top: 1px solid var(--border); + color: var(--text-meta); + font-size: 1.2rem; + + nav a { + color: var(--text-meta); + border-bottom: none; + + &:hover { + color: var(--link-hover); + } + } +} + +// Article list (index/section) + +main > ul { + list-style: none; + padding: 0; + margin: 0; + + li { + display: flex; + align-items: baseline; + gap: 1rem; + padding: 0.4em 0; + } + + time { + color: var(--text-meta); + font-size: 0.85rem; + font-family: $font-code; + white-space: nowrap; + } +} + +// Article (single post) + +article { + header { + margin-bottom: 1rem; + + h1 { + margin-bottom: 0.25em; + } + + time { + color: var(--text-meta); + font-size: 0.9rem; + } + + p { + color: var(--text-meta); + font-size: 0.9rem; + margin: 0.5em 0; + } + } +} + +// Table of contents + +article > nav[aria-label="Table of contents"] { + margin: 1rem 0; + + details { + border: 1px solid var(--border); + border-radius: 4px; + padding: 0.5em 1em; + } + + summary { + cursor: pointer; + color: var(--text-heading); + font-weight: bold; + } + + ul { + margin: 0.5em 0; + padding-left: 1.5em; + } + + li { + margin: 0.25em 0; + } + + a { + border-bottom: none; + + &:hover { + border-bottom: 1px solid var(--border); + } + } +} + +// Horizontal rule + +hr { + border: none; + border-top: 1px solid var(--border); + margin: 1.5rem 0; +} + +// Code + +code { + font-family: $font-code; + font-size: 0.9em; + background: var(--code-inline-bg); + border: 1px solid var(--code-inline-border); + padding: 0.15em 0.4em; + border-radius: 3px; +} + +pre { + background: var(--code-bg); + padding: 1rem; + overflow-x: auto; + border-radius: 4px; + line-height: 1.4; + + code { + background: none; + border: none; + padding: 0; + border-radius: 0; + font-size: 0.85em; + } +} + +// Blockquote + +blockquote { + border-left: 3px solid var(--border); + margin: 1em 0; + padding: 0.5em 1em; + background: var(--blockquote-bg); + color: var(--text); + + p { + margin: 0.5em 0; + } +} + +// Tables + +table { + display: block; + overflow-x: auto; + border-collapse: collapse; + margin: 1em 0; + width: 100%; +} + +th, td { + border: 1px solid var(--border); + padding: 0.5em 0.75em; + text-align: left; +} + +th { + color: var(--text-heading); + background: var(--table-header-bg); +} + +// Images + +img { + max-width: 100%; + height: auto; + display: block; + margin: 1em auto; +} + +// Lists inside articles + +article ul, +article ol { + padding-left: 1.5em; + + li { + margin: 0.3em 0; + } +} + +// Responsive + +@media (min-width: 600px) { + body { + padding: 3rem 2rem; + } +} themes/plc/templates/404.html @@ -0,0 +1,8 @@ +{%- extends "base.html" -%} +{%- block title %}404 — {{ config.title }}{% endblock title -%} +{%- block main %} + <h1>Not found</h1> + <p>This page does not exist. + <a href="{{ config.base_url }}">Return home</a> + </p> +{%- endblock main %} themes/plc/templates/base.html @@ -0,0 +1,32 @@ +{%- set date_format = config.extra.date_format | default(value="%y.%m.%d") -%} +<!doctype html> +<html lang="{{ config.default_language | default(value='en') }}"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + {%- block description %}{% endblock description -%} + <title>{%- block title %}{{ config.title }}{% endblock title -%}</title> + <link rel="stylesheet" href="{{ get_url(path='style.css') }}"> + <link rel="stylesheet" href="{{ get_url(path='print.css') }}" media="print"> + <link rel="icon" href="{{ get_url(path='favicon.ico') }}"> + {%- if config.generate_feeds %} + <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path='rss.xml') }}"> + {%- endif %} +</head> +<body> + <a href="#main" class="skip-link">Skip to content</a> + <main id="main"> + {%- block main %}{% endblock main -%} + </main> + <footer> + <nav aria-label="Footer"> + {%- if config.extra.plc_menu %} + {%- for item in config.extra.plc_menu %} + <a href="{{ get_url(path=item.link) }}">{{ item.text }}</a> · + {%- endfor %} + {%- endif %} + <a href="{{ config.base_url }}">{{ config.extra.home | default(value="home") }}</a> + </nav> + </footer> +</body> +</html> themes/plc/templates/index.html @@ -0,0 +1,17 @@ +{%- extends "base.html" -%} +{%- block title %}{{ section.title | default(value=config.title) }}{% endblock title -%} +{%- block main %} + <h1>{{ section.title | default(value=config.title) }}</h1> + {%- if section.pages %} + <ul> + {%- for page in section.pages %} + <li> + {%- if page.date %} + <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.date_format | default(value="%y.%m.%d")) }}</time> + {%- endif %} + <a href="{{ page.permalink }}">{{ page.title }}</a> + </li> + {%- endfor %} + </ul> + {%- endif %} +{%- endblock main %} themes/plc/templates/page.html @@ -0,0 +1,50 @@ +{%- extends "base.html" -%} +{%- block title %}{{ page.title }} — {{ config.title }}{% endblock title -%} +{%- block description -%} +{%- if page.description %} + <meta name="description" content="{{ page.description }}"> +{%- endif -%} +{%- endblock description -%} +{%- block main %} + <article> + <header> + <h1>{{ page.title }}</h1> + {%- if page.date %} + <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.date_format | default(value="%y.%m.%d")) }}</time> + {%- endif %} + {%- if page.reading_time %} + · {{ page.reading_time }} min read + {%- endif %} + {%- if page.taxonomies.tags %} + <p>Tags: + {%- for tag in page.taxonomies.tags %} + <a href="{{ get_taxonomy_url(kind='tags', name=tag) }}">{{ tag }}</a> + {%- if not loop.last %},{% endif %} + {%- endfor %} + </p> + {%- endif %} + {%- if page.description %} + <p>{{ page.description }}</p> + {%- endif %} + </header> + {%- if page.toc %} + <nav aria-label="Table of contents"> + <details> + <summary>Contents</summary> + <ul> + {%- for h1 in page.toc %} + <li><a href="#{{ h1.id }}">{{ h1.title }}</a> + {%- if h1.children %}<ul> + {%- for h2 in h1.children %} + <li><a href="#{{ h2.id }}">{{ h2.title }}</a></li> + {%- endfor %}</ul>{%- endif %} + </li> + {%- endfor %} + </ul> + </details> + </nav> + {%- endif %} + <hr> + {{ page.content | safe }} + </article> +{%- endblock main %} themes/plc/templates/section.html @@ -0,0 +1,18 @@ +{%- extends "base.html" -%} +{%- block title %}{{ section.title | default(value=config.title) }}{% endblock title -%} +{%- block main %} + <h1>{{ section.title | default(value=config.title) }}</h1> + {{ section.content | safe }} + {%- if section.pages %} + <ul> + {%- for page in section.pages %} + <li> + {%- if page.date %} + <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.date_format | default(value="%y.%m.%d")) }}</time> + {%- endif %} + <a href="{{ page.permalink }}">{{ page.title }}</a> + </li> + {%- endfor %} + </ul> + {%- endif %} +{%- endblock main %} themes/plc/templates/tags/list.html @@ -0,0 +1,12 @@ +{%- extends "base.html" -%} +{%- block title %}Tags — {{ config.title }}{% endblock title -%} +{%- block main %} + <h1>Tags</h1> + {%- if terms %} + <ul> + {%- for term in terms %} + <li><a href="{{ term.permalink }}">{{ term.name }}</a> ({{ term.pages | length }})</li> + {%- endfor %} + </ul> + {%- endif %} +{%- endblock main %} themes/plc/templates/tags/single.html @@ -0,0 +1,17 @@ +{%- extends "base.html" -%} +{%- block title %}{{ term.name }} — {{ config.title }}{% endblock title -%} +{%- block main %} + <h1>{{ term.name }}</h1> + {%- if term.pages %} + <ul> + {%- for page in term.pages %} + <li> + {%- if page.date %} + <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.date_format | default(value="%y.%m.%d")) }}</time> + {%- endif %} + <a href="{{ page.permalink }}">{{ page.title }}</a> + </li> + {%- endfor %} + </ul> + {%- endif %} +{%- endblock main %} themes/plc/theme.toml @@ -0,0 +1,11 @@ +name = "plc" +description = "A zero-JavaScript Zola theme with semantic HTML." +license = "MIT" +min_version = "0.19.0" + +[extra] +date_format = "%y.%m.%d" +home = "home" + +[author] +name = "pulec" zola.toml @@ -0,0 +1,37 @@ +# The URL the site will be built for +base_url = "https://example.com" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +theme = "plc" + +# RSS feed +generate_feeds = true +feed_filenames = ["rss.xml"] + +# Tags +taxonomies = [ + { name = "tags", rss = true }, +] + +[markdown] + +[markdown.highlighting] +# Pick theme @ https://textmate-grammars-themes.netlify.app/?theme=catppuccin-mocha&grammar=python +theme = "catppuccin-mocha" + +[extra] +# Put all your custom variables here +# Text is link in the footer link is to content/$link/_index.md +plc_menu = [ + { text = "tags", link = "tags" }, + { text = "about", link = "about" }, + { text = "projects", link = "projects" }, +] +home = "home" +# See e.g. https://devhints.io/datetime for cheatsheet +date_format = "%y.%m.%d"