v1.0.0
Changes
| README.md | +683 -0 | |
| sass/print.scss | +44 -0 | |
| sass/style.scss | +301 -0 | |
| templates/404.html | +8 -0 | |
| templates/base.html | +32 -0 | |
| templates/index.html | +17 -0 | |
| templates/page.html | +50 -0 | |
| templates/section.html | +17 -0 | |
| templates/tags/list.html | +12 -0 | |
| templates/tags/single.html | +17 -0 | |
| theme.toml | +11 -0 |
11 files changed, 1192 insertions, 0 deletions
Diff
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 +``` 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; +} 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; + } +} 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 %} 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> 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 %} 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 %} templates/section.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 %} 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 %} 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 %} 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"