Compare commits

...

5 Commits

Author SHA1 Message Date
294a6683b5 Improve structure in HTML templates
Some checks are pending
Publish / publish (push) Waiting to run
2025-04-11 17:54:23 +02:00
fc10706fba Update subproject link to docs #4 2025-04-11 17:14:08 +02:00
07323df99d Update blog #4 2025-04-11 17:09:49 +02:00
d7811db9f8 Fix localization 2025-04-11 17:09:20 +02:00
f97222f65d Write docs for Duckling #4
Add template for localization
2025-04-11 16:51:27 +02:00
36 changed files with 534 additions and 772 deletions

View File

@ -139,9 +139,9 @@ show_repo = true
# i.e. "@/blog/_index.md".
# See https://www.getzola.org/documentation/content/linking/#internal-links
links = [
{ url = "@/docs/gettingstarted/index.md", name = "Docs" },
{ url = "@/blog/_index.md", name = "Blog" },
{ url = "@/subprojects/_index.md", name = "Subprojects" },
{ url = "@/docs/overview/index.md", name = "Docs" },
{ url = "@/demo/index.md", name = "Demo" },
]
@ -149,9 +149,9 @@ links = [
# Links used in the footer.
# Same as the nav ones.
links = [
{ url = "@/docs/gettingstarted/index.md", name = "Docs" },
{ url = "@/blog/_index.md", name = "Blog" },
{ url = "@/subprojects/_index.md", name = "Subprojects" },
{ url = "@/docs/overview/index.md", name = "Docs" },
{ url = "@/demo/index.md", name = "Demo" },
{ url = "https://mastodon.de/@david_swift", name = "Developer" }
]

View File

@ -17,200 +17,9 @@ Duckling is an minimal and feature-rich [Zola](https://www.getzola.org) theme th
It is based on the [Duckquill](https://duckquill.daudix.one) theme for blogs.
Some of the features Duckling has to offer:
- Cute and informative social media cards for Discourse, Facebook, LinkedIn, Mastodon and more.
- [Mastodon-powered comments](https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/); comment under a post by using your Mastodon account.
- Lightweight by default, powerful when needed; no mandatory JavaScript is used by default.
- Privacy respecting analytics using [GoatCounter](https://www.goatcounter.com), with support for self-hosting.
- Estimated read time of the post; put away those with short attention spans.
- A user-defined accent color for a pleasant look.
- GitHub-style alerts. Yes, they're pretty, but don't overuse them.
- Post banners; they're even used in the social media cards!
- YouTube/Vimeo shortcodes for easy video embedding.
- Tiny by default; only ~100kB. Take that, 5MB Medium!
- Customizable copyright text; you Better Quack Soul!
- Image styling via URL. Yes, you read that right.
- Useless CRT style that everyone seems to like.
- Fully localizeable, worry not, [it's pretty easy](#localization).
- Social links in the footer, with special styling.
- LaTeX markup support via the [KaTeX](https://katex.org) library.
- Emoji favicon if you're lazy to draw one.
- Copy button for code blocks.
## Installation
First, if you already have Git setup, add this theme as a submodule:
```bash
git submodule init
git submodule add https://git.aparoksha.dev/david-swift/duckling themes/duckling
```
Otherwise, simply clone it to your `themes` directory:
```bash
git clone https://git.aparoksha.dev/david-swift/duckling themes/duckling
```
{% alert(important=true) %}
It is highly recommended to switch from the `main` branch to the latest release:
{% end %}
```bash
cd themes/duckling
git checkout tags/v0.1.0
```
Then, enable it in your `config.toml`:
```toml
theme = "duckling"
```
To update the theme, simply switch to a new tag:
```bash
git submodule update --remote --merge
cd themes/duckling
git checkout tags/v0.1.0
```
{% alert(important=true) %}
Check the changelog for all versions after the one you are using; there may be breaking changes that require manual involvement.
{% end %}
## Options
Duckling offers some configuration options to make it fit you better; most options have pretty descriptive comments, so it should be easy to understand what they do.
## Front Matter
Duckling has some [front matter](https://www.getzola.org/documentation/content/page/#front-matter) variables that you can use by setting them in the `[extra]` section:
### Global
Configuration variables from `config.toml` that can be set/overriden per page/section:
- `default_theme`: Which theme should be used by default (light/dark).
- `accent_color`: Sets theme and [browser theme](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color) color.
- `accent_color_dark`: Ditto but for the dark theme. If not set regular variant will be used.
- `emoji_favicon`: Use emoji as a favicon. Only one emoji is being rendered, everything else is truncated.
- `styles`: Additional CSS styles; expects them to be in the `./static/` directory. If you are using Sass it will be generated there automatically.
- `scripts`: Additional JavaScript scripts; expects them to be in the `./static/` directory.
- `katex`: Whether to enable the KaTeX library for rendering LaTeX.
- `toc`: Enables table of contents. Only first 2 levels of headings are listed.
- `toc_inline`: Whether to render inline table of contents at the top of all pages, in addition to floating quick navigation buttons.
- `toc_ordered`: Whether to use numbered (ordered) list for table of contents.
Other variables:
- `apple_touch_icon`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) Apple Touch Icon.
- `favicon`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) favicon.
- `card`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) metadata card.
- `archive`: Displays an archived message.
- `trigger`: Displays a trigger warning message.
- `disclaimer`: Displays a disclaimer message.
- `left_align_badges`: Left-align badges in subprojects lists.
- `hide_subproject_tags`: Hide the link to the list of tags in subprojects lists.
- `hide_number_of_subprojects`: Hide the subprojects counter in a subproject list.
### Blog Post Specific
- `banner`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) banner image. Recommended dimensions are 2:1 aspect ratio and 1920x960 resolution.
- `banner_pixels` Makes the banner use nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.
- `archived`: Make the post visually stand out in the post list. Also accepts message as a value.
- `featured`: Ditto but doesn't accept message as a value.
- `hot`: Ditto.
- `poor`: Ditto.
In `[extra.comments]` section:
- `host`: The Mastodon server on which the post was posted.
- `user`: The username of the poster.
- `id`: ID of the post; the one in the URL.
### Subproject Specific
All the options for blog posts are available for subprojects as well.
Additionally, you can use the following front matter variables:
- `preview`: Filename of the image displayed in the subprojects list.
- `expand`: Make the subproject use the full width in the subprojects list.
- `url`: Instead of showing the page's content, redirect from the subprojects list to the given URL.
- `badge`: A label displayed in the item's corner in the subprojects list.
### Documentation Page Specific
All the options for blog posts are avilable for documentation pages as well, with the exception of banners.
Additionally, you can use the following front matter variables:
- `section`: Assign the page to the section with the given index. The sections are defined in the Zola section (the `_index.md`). Use `0` to place it above all the sections.
### Documentation Specific
- `sections`: The sections available in the documentation.
### Localization
Duckling ships with a localization system based on one used in [tabi](https://github.com/welpo/tabi), it's very easy to use and quite flexible at the same time.
To add a translation, simply create a file in your site's `i18n` directory called `LANG_CODE.toml`, e.g `fr.toml`. The language code should be either [ISO 639-1](https://localizely.com/iso-639-1-list/) or [BCP 47](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
Inside that file, copy-paste one of the existing translations from Duckling and adapt it to your needs. You can also check [tabi](https://github.com/welpo/tabi/tree/main/i18n) translation files for reference.
Additionally to translating Duckling, you can also override the English stings by copy-pasting `en.toml` from Duckling to the `i18n` directory of your website and adjusting the values to your liking.
### Custom Styles
To add your own or override existing styles, create a custom style and add it in the `config.toml`:
```toml
[extra]
styles = [
"YOUR_STYLE.css",
"ALSO_YOUR_STYLE.css"
]
```
Additional styles are expected it to be in the `static` directory. If you are using Sass they will be compiled there by default.
If for some reason overridden style is not respected, try using `!important` (don't use it unless needed). You can import styles from Duckling using:
```scss
@use "../themes/duckling/sass/NEEDED_FILE.scss";
```
You can also load styles per page/section by setting them inside page's front matter:
```toml
[extra]
styles = [
"YOUR_PAGE_STYLE.css"
]
```
### Accent Color
Duckling respects chosen accent color everywhere. To use your own, simply change it in `config.toml`:
```toml
[extra]
accent_color = "#3584e4"
```
Additionally, you can set a separate color for dark mode:
```toml
[extra]
accent_color_dark = "#ff7800"
```
### Favicon
Files named `favicon.png` and `apple-touch-icon.png` are used as favicon and Apple Touch Icon respectively. For animated favicon you can use APNG with the `png` file extension.
<div class="buttons" style="margin-top: 30px;">
<a href="/docs/gettingstarted">Getting Started</a>
</div>
## In the Wild

View File

@ -0,0 +1,23 @@
+++
authors = ["david-swift"]
title = "Release 0.1.0"
description = "The birth of a duckling!"
date = 2025-04-13
[taxonomies]
tags = ["Release", "Demo", "Test"]
[extra.comments]
host = "mastodon.de"
user = "david_swift"
id = "" # TODO: Add id
+++
Duckling is here!
Almost everything that [Duckquill](https://duckquill.daudix.one) offers is available in Duckling in a more minimal design.
Additionally, the following features were added:
- Project documentation! Find a demo under [Docs](/docs/gettingstarted/).
- [Subprojects](/subprojects), a way to showcase a project's features.
Learn how to use Duckling for your own project website in the [docs](/docs/gettingstarted/).

View File

@ -1,9 +1,8 @@
+++
title = "Writings of Duck's Feet"
title = "Blog"
sort_by = "date"
template = "article_list.html"
page_template = "article.html"
paginate_by = 2
+++
Welcome to my quack'in blog, I quack about various stuff, but mostly I'm a demo.
News about the latest changes in the Duckling project.

View File

@ -1,16 +0,0 @@
+++
authors = ["John Dolor"]
title = "Dolor"
description = "Lorem ipsum dolor sit amet."
date = 1970-01-03
[taxonomies]
tags = ["Lorem", "Ipsum", "Dolor"]
[extra]
archive = true
+++
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.

View File

@ -1,15 +0,0 @@
+++
authors = ["John Draft"]
title = "Drafty Draft"
description = "Drafted post, very drafty."
date = 2024-04-29
draft = true
[taxonomies]
tags = ["Draft"]
+++
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.

View File

@ -1,16 +0,0 @@
+++
authors = ["John Ipsum"]
title = "Ipsum"
description = "Lorem ipsum dolor sit amet."
date = 1970-01-02
[taxonomies]
tags = ["Lorem", "Ipsum"]
[extra]
hot = true
+++
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.

View File

@ -1,18 +0,0 @@
+++
authors = ["Looong Looong Man", "Alexander Maximilian Jonathan"]
title = "Loooooong Loooooong Loooooong Loooooong Loooooong Man"
description = "Pneumonoultramicroscopicsilicovolcanoconiosis supercalifragilisticexpialidocious pseudopseudohypoparathyroidism."
date = 2017-01-01
[taxonomies]
tags = ["Honorificabilitudinitatibus"]
[extra]
featured = true
+++
![Long Long Man](https://upload.wikimedia.org/wikipedia/en/e/ed/Long_Long_Man.jpeg#end#spoiler)
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.

View File

@ -1,16 +0,0 @@
+++
authors = ["John Lorem"]
title = "Lorem"
description = "Lorem ipsum dolor sit amet."
date = 1970-01-01
[taxonomies]
tags = ["Lorem"]
[extra]
poor = true
+++
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.
Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

View File

@ -1,106 +0,0 @@
+++
authors = ["Scrooge McDuck", "Darkwing Duck"]
title = "The Quill of Duck"
description = "This is a Duckling post example, this post has nothing but a bunch of text and random formatting, acting like a demo."
date = 2023-08-31
updated = "2024-06-21"
[taxonomies]
tags = ["Demo", "Test"]
[extra]
banner = "banner.webp"
toc = true
toc_inline = true
toc_ordered = true
trigger = "This page contains blackjack and hookers, and bad jokes such as this one."
disclaimer = """
- All tricks in this page are performed by the lab boys, don't try this at home.
- Don't expose yourself to 4000° kelvin.
- Don't take party escort submission position.
- Don't interact with asbestos and moon rocks.
"""
[extra.comments]
# Long thread with image
#
# host = "mastodon.social"
# user = "brownpau"
# id = "104529877688537579"
#
# Thread with multiple images per post
#
# host = "mastodon.blaede.family"
# user = "cassidy"
# id = "112774854109302186"
#
# Thread with preview cards
# host = "mastodon.blaede.family"
# user = "cassidy"
# id = "110669429936617026"
#
# Post on GoToSocial
#
# host = "alpha.polymaths.social"
# user = "orbitalmartian"
# id = "01J7ETKJ19FGBDQGS1ZWZ3KEPP"
#
# Post on Sharkey
#
# host = "is-a.wyvern.rip"
# user = "volpeon"
# id = "9qy755nsnu2c0hbc"
host = "toot.community"
user = "sungsphinx"
id = "111789185826519979"
+++
{% alert(tip=true) %}
Recommended banner dimensions are 2:1 aspect ratio and 1920x960 resolution.
Other sizes will also work, but will be cut off at the bottom/won't be high enough.
{% end %}
## The what?
This is a Duckling post example, this post has nothing but a bunch of text and random formatting, acting like a demo.
## Some info
Well, open this file and look at how it's made, it includes all the essential front matter stuff.
Now to the _Stanley!_
## The _Stanley_!
This is the story of a man named _Stanley_.
_Stanley_ worked for a company in a big building where he was Employee `#427`.
<figure>
![The Office](the-office.webp)
<figcaption>The Office where Stanley works, it has yellow floor and beige walls</figcaption>
</figure>
Employee `#427`'s job was simple: he sat at his desk in Room `427` and he pushed buttons on a keyboard.
Orders came to him through a monitor on his desk telling him what buttons to push, how long to push them, and in what order.
This is what Employee `#427` did every day of every month of every year, and although others may have considered it soul rending,
_Stanley_ relished every moment that the orders came in, as though he had been made exactly for this job.
And _Stanley_ was happy.
And then one day, something very peculiar happened.
Something that would forever change _Stanley_;
Something he would never quite forget.
He had been at his desk for nearly an hour when he had realized not one single order had arrived on the monitor for him to follow.
No one had shown up to give him instructions, call a meeting, or even say 'hi'. Never in all his years at the company had this happened, this complete isolation.
Something was very clearly wrong. Shocked, frozen solid, _Stanley_ found himself unable to move for the longest time.
But as he came to his wits and regained his senses, he got up from his desk and stepped out of his office.
All of his co-workers were gone. What could it mean? Stanley decided to go to the meeting room; perhaps he had simply missed a memo.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View File

@ -5,6 +5,7 @@ page_template = "documentation_page.html"
[extra]
sections = [
"More"
"Usage",
"Advanced"
]
+++

View File

@ -0,0 +1,40 @@
+++
weight = 1
title = "Blogs"
[extra]
section = 1
+++
A blog is a place to publish articles. Take a look at the [sample blog](/blog).
To create a blog, start with a [Zola section](https://www.getzola.org/documentation/content/section/).
Set the following front matter variables:
```toml
template = "article_list.html"
page_template = "article.html"
```
Then, add [pages](https://www.getzola.org/documentation/content/page/).
## Options
Use the default [Zola section front matter variables](https://www.getzola.org/documentation/content/section/#front-matter) to configure the blog.
In addition to the [default front matter variables for pages](https://www.getzola.org/documentation/content/page/#front-matter), Duckling provides some additional variables that can be set under `[extra]`:
- `banner`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) banner image. Recommended dimensions are 2:1 aspect ratio and 1920x960 resolution, make sure it works with the navigation bar in light and dark mode.
- `banner_pixels` Makes the banner use nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.
- `archived`: Make the post visually stand out in the post list. Also accepts message as a value.
- `featured`: Ditto but doesn't accept message as a value.
- `hot`: Ditto.
- `poor`: Ditto.
The following options are available in the `[extra.comments]` section:
- `host`: The Mastodon server on which the post was posted.
- `user`: The username of the poster.
- `id`: ID of the post; the one in the URL.
## Example
The code for the [sample blog](/blog) can be used as a reference or as a starting point. It is available [in the project's source code](https://git.aparoksha.dev/david-swift/duckling/src/branch/main/content/blog).

View File

@ -0,0 +1,38 @@
+++
weight = 1
title = "Configuration"
[extra]
section = 0
+++
Duckling offers a number of variables that can be set in the a website's `config.toml` file.
The following configuration variables from `config.toml` can be set/overriden per page/section:
- `default_theme`: Which theme should be used by default (light/dark).
- `accent_color`: Sets theme and [browser theme](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color) color.
- `accent_color_dark`: Ditto but for the dark theme. If not set regular variant will be used.
- `emoji_favicon`: Use emoji as a favicon. Only one emoji is being rendered, everything else is truncated.
- `styles`: Additional CSS styles; expects them to be in the `./static/` directory. If you are using Sass it will be generated there automatically.
- `scripts`: Additional JavaScript scripts; expects them to be in the `./static/` directory.
- `katex`: Whether to enable the KaTeX library for rendering LaTeX.
- `toc`: Enables table of contents. Only first 2 levels of headings are listed.
- `toc_inline`: Whether to render inline table of contents at the top of all pages, in addition to floating quick navigation buttons.
- `toc_ordered`: Whether to use numbered (ordered) list for table of contents.
The following variables can be set in the `config.tom` file:
- `apple_touch_icon`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) Apple Touch Icon.
- `favicon`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) favicon.
- `card`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) metadata card.
- `archive`: Displays an archived message.
- `trigger`: Displays a trigger warning message.
- `disclaimer`: Displays a disclaimer message.
- `left_align_badges`: Left-align badges in subprojects lists.
- `hide_subproject_tags`: Hide the link to the list of tags in subprojects lists.
- `hide_number_of_subprojects`: Hide the subprojects counter in a subproject list.
## Favicon
Files named `favicon.png` and `apple-touch-icon.png` are used as favicon and Apple Touch Icon respectively. For animated favicon you can use APNG with the `png` file extension.

View File

@ -1,8 +0,0 @@
+++
weight = 2
title = "Details"
[extra]
section = 1
+++
This is overview's content!

View File

@ -0,0 +1,53 @@
+++
weight = 3
title = "Docs"
[extra]
section = 1
+++
Document a tool using the built-in documentation feature.
To create a documentation page, start with a [Zola section](https://www.getzola.org/documentation/content/section/).
Set the following front matter variable:
```toml
page_template = "documentation_page.html"
```
Then, add [pages](https://www.getzola.org/documentation/content/page/).
Use the `sections` front matter variable in the section and the `section` front matter variable in the individual pages to group multiple pages to a docs section.
## Options
### Section
Use the default [Zola section front matter variables](https://www.getzola.org/documentation/content/section/#front-matter) to configure the docs.
Duckling provides the following additional variable:
- `sections`: The sections available in the documentation.
Use the following syntax:
```toml
[extra]
sections = [
"Usage", # Section 1
"Extra" # Section 2
]
```
### Page
In addition to the [default front matter variables for pages](https://www.getzola.org/documentation/content/page/#front-matter), Duckling provides some additional variables that can be set under `[extra]`:
- `section`: Assign the page to the section with the given index. The sections are defined in the Zola section (the `_index.md`). Use `0` to place it above all the sections, `1` for the first section, etc.
The following options are available in the `[extra.comments]` section:
- `host`: The Mastodon server on which the post was posted.
- `user`: The username of the poster.
- `id`: ID of the post; the one in the URL.
## Example
The code for Duckling's docs can be used as a reference or as a starting point. It is available [in the project's source code](https://git.aparoksha.dev/david-swift/duckling/src/branch/main/content/docs).

View File

@ -0,0 +1,48 @@
+++
weight = 0
title = "Getting Started"
[extra]
section = 0
+++
Duckling is a theme for the [Zola](https://www.getzola.org/) static site generator.
Follow the instructions in the [Getting Started section](https://www.getzola.org/documentation/getting-started/overview/) in their documentation.
## Installation
After having a Zola website setup, you can install the Duckling theme.
First, if you already have Git setup, add this theme as a submodule:
```bash
git submodule init
git submodule add https://git.aparoksha.dev/david-swift/duckling themes/duckling
```
Otherwise, simply clone it to your `themes` directory:
```bash
git clone https://git.aparoksha.dev/david-swift/duckling themes/duckling
```
It is highly recommended to switch from the `main` branch to the latest release:
```bash
cd themes/duckling
git checkout tags/v0.1.0
```
Then, enable it in your `config.toml`:
```toml
theme = "duckling"
```
To update the theme, simply switch to a new tag:
```bash
git submodule update --remote --merge
cd themes/duckling
git checkout tags/v0.1.0
```

View File

@ -0,0 +1,14 @@
+++
weight = 0
title = "Localization"
[extra]
section = 2
+++
Duckling ships with a localization system based on one used in [tabi](https://github.com/welpo/tabi), which is easy to use and flexible at the same time.
To add a translation, simply create a file in your site's `i18n` directory called `LANG_CODE.toml`, e.g `fr.toml`. The language code should be either [ISO 639-1](https://localizely.com/iso-639-1-list/) or [BCP 47](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
Inside that file, copy-paste the [English translation from Duckling](https://git.aparoksha.dev/david-swift/duckling/src/branch/main/i18n/en.toml) and adapt it to your needs. You can also check [tabi](https://github.com/welpo/tabi/tree/main/i18n) translation files for reference.
Additionally to translating Duckling, you can override the English strings by providing a `en.toml` file.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

View File

@ -1,8 +0,0 @@
+++
weight = 0
title = "Overview"
[extra]
section = 0
+++
This is overview's content!

View File

@ -1,8 +0,0 @@
+++
weight = 1
title = "Page 2"
[extra]
section = 1
+++
Another page

View File

@ -0,0 +1,33 @@
+++
weight = 1
title = "Styling"
[extra]
section = 2
+++
To add your own or override existing styles, create a custom style and add it in the `config.toml`:
```toml
[extra]
styles = [
"YOUR_STYLE.css",
"ALSO_YOUR_STYLE.css"
]
```
Additional styles are expected it to be in the `static` directory. Sass files will be compiled there by default.
If for some reason overridden style is not respected, try using `!important` (don't use it unless needed). You can import styles from Duckling using:
```scss
@use "../themes/duckling/sass/NEEDED_FILE.scss";
```
You can also load styles per page/section by setting them inside the page's front matter:
```toml
[extra]
styles = [
"YOUR_PAGE_STYLE.css"
]
```

View File

@ -0,0 +1,42 @@
+++
weight = 2
title = "Subprojects"
[extra]
section = 1
+++
The subprojects feature is designed to showcase the capabilities of a project, but it can be used for many other purposes as well.
Check out the demo [here](/subprojects).
To create a collection of subprojects, start with a [Zola section](https://www.getzola.org/documentation/content/section/).
Set the following front matter variables:
```toml
template = "subproject_list.html"
page_template = "subproject.html"
```
Then, add [pages](https://www.getzola.org/documentation/content/page/).
Make sure to set the `preview` front matter variable if you want to include a preview picture in the collection.
## Options
Use the default [Zola section front matter variables](https://www.getzola.org/documentation/content/section/#front-matter) to configure the subprojects collection.
In addition to the [default front matter variables for pages](https://www.getzola.org/documentation/content/page/#front-matter), Duckling provides some additional variables that can be set under `[extra]`:
- `preview`: Filename of the image displayed in the subprojects list.
- `expand`: Make the subproject use the full width in the subprojects list.
- `url`: Instead of showing the page's content, redirect from the subprojects list to the given URL.
- `badge`: A label displayed in the item's corner in the subprojects list.
- `banner`: Filename of the [colocated](https://www.getzola.org/documentation/content/overview/#asset-colocation) banner image. Recommended dimensions are 2:1 aspect ratio and 1920x960 resolution, make sure it works with the navigation bar in light and dark mode.
- `banner_pixels` Makes the banner use nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.
The following options are available in the `[extra.comments]` section:
- `host`: The Mastodon server on which the post was posted.
- `user`: The username of the poster.
- `id`: ID of the post; the one in the URL.
## Example
The code for the [sample subproject collection](/subprojects) can be used as a reference or as a starting point. It is available [in the project's source code](https://git.aparoksha.dev/david-swift/duckling/src/branch/main/content/subprojects).

View File

@ -6,8 +6,8 @@ description = "No need for a separate documentation page - coming soon!"
tags = ["Demo", "Test"]
[extra]
preview = "pond.jpg"
badge = "Coming Soon"
url = "https://example.com"
badge = "New"
url = "/docs/gettingstarted"
+++
This feature is not yet implemented. Coming soon!

View File

@ -6,7 +6,6 @@ description = "Showcase parts of your project!"
tags = ["Demo", "Test"]
[extra]
preview = "duckling.jpg"
badge = "New"
expand = true
+++

87
i18n/en.toml Normal file
View File

@ -0,0 +1,87 @@
# Shown in language picker for multi-language sites
language_name = "English"
# Tera date format used for listing posts
# (post publication date, tag posts list...).
# Not used in comments, "date_locale" is used instead.
# See https://docs.rs/chrono/0.4.31/chrono/format/strftime/index.html
date_format = "%B %d, %Y"
date_locale = "en_US"
# Menu items.
# Should match the names in config.extra.nav.links and config.extra.footer.links.
Docs = "Docs"
Blog = "Blog"
Subprojects = "Subprojects"
Demo = "Demo"
Developer = "Developer"
all_tags = "See all tags"
archived = "Archived"
author = "Author"
author_conjunction = " and "
author_separator = ", "
back = "Back"
backlinks = "Backlinks"
blog_post_author = "Blog post author"
boosts_from = "Boosts from $INSTANCE"
by_author = "By $AUTHOR"
caution = "Caution"
comments = "Comments"
comments_description = "You can comment on this blog post by publicly replying to this post using a Mastodon or other ActivityPub/Fediverse account. Known non-private replies are displayed below."
comments_noscript = "Loading comments relies on JavaScript. Try enabling JavaScript and reloading, or visit the original post on Mastodon."
comments_qr = "QR code to a Mastodon post"
copy_code = "Copy Code"
disclaimer = "Disclaimer"
drafted = "Drafted"
faves_from = "Favorites from $INSTANCE"
featured = "Featured"
feed = "Feed"
file_an_issue = "File an Issue"
filter_by_tag = "Filter by tag"
first = "First"
go_to_top = "Go to Top"
hot = "Hot"
important = "Important"
language = "Language"
last = "Last"
load_comments = "Load Comments"
loading = "Loading"
many_minutes_read = "$NUMBER minutes read"
many_posts = "$NUMBER posts in total"
many_tags = "$NUMBER tags in total"
minutes_read = "$NUMBER minute read"
more_matches = "$MATCHES more matches"
next = "Next"
no_comments = "No Comments yet :/"
note = "Note"
one_posts = "$NUMBER post in total"
one_tags = "$NUMBER tag in total"
open_post = "Open Post"
poor = "Poor"
posts = "$NUMBER posts in total"
posts_with_tag = "Posts with tag $TAG"
powered_by = "Powered by $ZOLA and $DUCKLING"
previous = "Previous"
published = "Published on"
reload = "Reload"
repo = "Repository"
search = "Search"
search_for = "Search for"
sensitive = "Sensitive Content"
share = "Share"
skip_to_content = "Skip to Main Content"
source = "Website source"
table_of_contents = "Table of Contents"
tags = "tags"
tags_title = "Tags"
theme = "Theme"
theme_dark = "Switch to Dark Theme"
theme_light = "Switch to Light Theme"
theme_system = "Use System Theme"
tip = "Tip"
trigger_warning = "Trigger Warning"
updated = "Updated on"
view_comment = "View Comment At"
view_profile = "View Profile At"
warning = "Warning"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

View File

@ -12,126 +12,8 @@
{%- endif -%}
<article>
{%- if page.extra.banner -%}
<div id="banner-container">
<img id="banner" class="full-bleed{% if page.extra.banner_pixels %} pixels{% endif %}" src="{{ current_url ~ page.extra.banner }}" {% if config.markdown.lazy_async_image %}decoding="async" loading="lazy"{% endif %} />
</div>
{%- endif -%}
<div id="heading">
{%- if page.date -%}
<p>
<small>
<time datetime="{{ page.date | date(format=' %+') }}">
{{- macros_translate::translate(key="published", default="Published on", language_strings=language_strings) }}
{{ page.date | date(format=date_format, locale=date_locale) -}}
</time>
{%- if page.updated -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
<time datetime="{{ page.updated | date(format=' %+') }}">
{{- macros_translate::translate(key="updated", default="Updated on", language_strings=language_strings) }}
{{ page.updated | date(format=date_format, locale=date_locale) -}}
</time>
{%- endif -%}
</small>
</p>
{%- endif -%}
<h1>{{ page.title }}</h1>
{%- if page.authors or config.extra.show_reading_time -%}
<p>
<small>
{%- if page.authors -%}
<span>{% include "partials/authors.html" -%}</span>
{%- if config.extra.show_reading_time -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
{%- if config.extra.show_reading_time -%}
<span>{{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }}</span>
{%- if page.taxonomies -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
</small>
</p>
{%- endif -%}
{%- if page.taxonomies -%}
{%- for name, taxon in page.taxonomies %}
<ul class="tags">
{%-for item in taxon -%}
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
{%- endfor %}
</ul>
{%- endfor -%}
{%- endif %}
</div>
<div id="buttons-container">
{%- if page.extra.toc and page.toc | length > 0 -%}
<details id="toc" class="closable">
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
<div>
<{{ list_element }}>
{%- for h1 in page.toc -%}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{%- if h1.children -%}
<{{ list_element }}>
{%- for h2 in h1.children -%}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{%- endfor -%}
</{{ list_element }}>
{%- endif -%}
</li>
{%- endfor -%}
</{{ list_element }}>
</div>
</div>
</details>
{%- endif -%}
{%- if config.extra.show_backlinks and page.backlinks | length > 0 -%}
<details id="backlinks" class="closable">
<summary title="{{ macros_translate::translate(key='backlinks', default='Backlinks', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="backlinks", default="Backlinks", language_strings=language_strings) }}</strong>
<div>
<ul>
{%- for backlink in page.backlinks -%}
<li>
<a href="{{ backlink.permalink }}">{{ backlink.title }}</a>
</li>
{%- endfor -%}
</ul>
</div>
</div>
</details>
{%- endif -%}
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- if config.extra.show_share_button -%}
<a id="share" href="https://shareopenly.org/share/?url={{ page.permalink }}{% if page.description %}&text={{ page.description | urlencode }}{% endif %}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='share', default='Share', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
{%- if config.extra.issues_url -%}
<a id="issue" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='file_an_issue', default='File an Issue', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
</div>
{%- include "partials/statements.html" -%}
{%- if page.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- elif config.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ page.content | safe }}
{% include "partials/banner.html" %}
{% include "partials/article_content.html" %}
</article>
{%- if page.extra.comments.id -%}

View File

@ -43,24 +43,6 @@
</p>
{% include "partials/articles.html" %}
{% include "partials/paginator.html" %}
{%- if paginator.pages -%}
<nav id="paginator">
{%- if paginator.previous -%}
<a id="paginator-previous" href="{{ paginator.previous }}">
<i class="icon"></i>
<div>{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}</div>
</a>
{%- endif -%}
<div></div>
{%- if paginator.next -%}
<a id="paginator-next" href="{{ paginator.next }}">
<div>{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}</div>
<i class="icon"></i>
</a>
{%- endif -%}
</nav>
{%- endif -%}
{% endblock content %}

View File

@ -19,103 +19,7 @@ expand-main
{% include "partials/docs_toc.html" %}
<article>
<div id="heading">
<h1>{{ page.title }}</h1>
{%- if page.authors or config.extra.show_reading_time -%}
<p>
<small>
{%- if page.authors -%}
<span>{% include "partials/authors.html" -%}</span>
{%- if config.extra.show_reading_time -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
{%- if config.extra.show_reading_time -%}
<span>{{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }}</span>
{%- if page.taxonomies -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
</small>
</p>
{%- endif -%}
{%- if page.taxonomies -%}
{%- for name, taxon in page.taxonomies %}
<ul class="tags">
{%-for item in taxon -%}
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
{%- endfor %}
</ul>
{%- endfor -%}
{%- endif %}
</div>
<div id="buttons-container">
{%- if page.extra.toc and page.toc | length > 0 -%}
<details id="toc" class="closable">
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
<div>
<{{ list_element }}>
{%- for h1 in page.toc -%}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{%- if h1.children -%}
<{{ list_element }}>
{%- for h2 in h1.children -%}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{%- endfor -%}
</{{ list_element }}>
{%- endif -%}
</li>
{%- endfor -%}
</{{ list_element }}>
</div>
</div>
</details>
{%- endif -%}
{%- if config.extra.show_backlinks and page.backlinks | length > 0 -%}
<details id="backlinks" class="closable">
<summary title="{{ macros_translate::translate(key='backlinks', default='Backlinks', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="backlinks", default="Backlinks", language_strings=language_strings) }}</strong>
<div>
<ul>
{%- for backlink in page.backlinks -%}
<li>
<a href="{{ backlink.permalink }}">{{ backlink.title }}</a>
</li>
{%- endfor -%}
</ul>
</div>
</div>
</details>
{%- endif -%}
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- if config.extra.show_share_button -%}
<a id="share" href="https://shareopenly.org/share/?url={{ page.permalink }}{% if page.description %}&text={{ page.description | urlencode }}{% endif %}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='share', default='Share', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
{%- if config.extra.issues_url -%}
<a id="issue" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='file_an_issue', default='File an Issue', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
</div>
{%- include "partials/statements.html" -%}
{%- if page.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- elif config.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ page.content | safe }}
{% include "partials/article_content.html" %}
</article>
<div id="toc-hidden">

View File

@ -0,0 +1,114 @@
<div id="heading">
{%- if page.date -%}
<p>
<small>
<time datetime="{{ page.date | date(format=' %+') }}">
{{- macros_translate::translate(key="published", default="Published on", language_strings=language_strings) }}
{{ page.date | date(format=date_format, locale=date_locale) -}}
</time>
{%- if page.updated -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
<time datetime="{{ page.updated | date(format=' %+') }}">
{{- macros_translate::translate(key="updated", default="Updated on", language_strings=language_strings) }}
{{ page.updated | date(format=date_format, locale=date_locale) -}}
</time>
{%- endif -%}
</small>
</p>
{%- endif -%}
<h1>{{ page.title }}</h1>
{%- if page.authors or config.extra.show_reading_time -%}
<p>
<small>
{%- if page.authors -%}
<span>{% include "partials/authors.html" -%}</span>
{%- if config.extra.show_reading_time -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
{%- if config.extra.show_reading_time -%}
<span>{{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }}</span>
{%- if page.taxonomies -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
</small>
</p>
{%- endif -%}
{%- if page.taxonomies -%}
{%- for name, taxon in page.taxonomies %}
<ul class="tags">
{%-for item in taxon -%}
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
{%- endfor %}
</ul>
{%- endfor -%}
{%- endif %}
</div>
<div id="buttons-container">
{%- if page.extra.toc and page.toc | length > 0 -%}
<details id="toc" class="closable">
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
<div>
<{{ list_element }}>
{%- for h1 in page.toc -%}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{%- if h1.children -%}
<{{ list_element }}>
{%- for h2 in h1.children -%}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{%- endfor -%}
</{{ list_element }}>
{%- endif -%}
</li>
{%- endfor -%}
</{{ list_element }}>
</div>
</div>
</details>
{%- endif -%}
{%- if config.extra.show_backlinks and page.backlinks | length > 0 -%}
<details id="backlinks" class="closable">
<summary title="{{ macros_translate::translate(key='backlinks', default='Backlinks', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="backlinks", default="Backlinks", language_strings=language_strings) }}</strong>
<div>
<ul>
{%- for backlink in page.backlinks -%}
<li>
<a href="{{ backlink.permalink }}">{{ backlink.title }}</a>
</li>
{%- endfor -%}
</ul>
</div>
</div>
</details>
{%- endif -%}
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- if config.extra.show_share_button -%}
<a id="share" href="https://shareopenly.org/share/?url={{ page.permalink }}{% if page.description %}&text={{ page.description | urlencode }}{% endif %}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='share', default='Share', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
{%- if config.extra.issues_url -%}
<a id="issue" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='file_an_issue', default='File an Issue', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
</div>
{%- include "partials/statements.html" -%}
{%- if page.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- elif config.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ page.content | safe }}

View File

@ -0,0 +1,5 @@
{%- if page.extra.banner -%}
<div id="banner-container">
<img id="banner" class="full-bleed{% if page.extra.banner_pixels %} pixels{% endif %}" src="{{ current_url ~ page.extra.banner }}" {% if config.markdown.lazy_async_image %}decoding="async" loading="lazy"{% endif %} />
</div>
{%- endif -%}

View File

@ -0,0 +1,19 @@
{%- if paginator.pages -%}
<nav id="paginator">
{%- if paginator.previous -%}
<a id="paginator-previous" href="{{ paginator.previous }}">
<i class="icon"></i>
<div>{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}</div>
</a>
{%- endif -%}
<div></div>
{%- if paginator.next -%}
<a id="paginator-next" href="{{ paginator.next }}">
<div>{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}</div>
<i class="icon"></i>
</a>
{%- endif -%}
</nav>
{%- endif -%}

View File

@ -12,109 +12,8 @@
{%- set section = get_section(path=page.ancestors | last) -%}
<article>
{%- if page.extra.banner -%}
<div id="banner-container">
<img id="banner" class="full-bleed{% if page.extra.banner_pixels %} pixels{% endif %}" src="{{ current_url ~ page.extra.banner }}" {% if config.markdown.lazy_async_image %}decoding="async" loading="lazy"{% endif %} />
</div>
{%- endif -%}
<div id="heading">
<h1>{{ page.title }}</h1>
{%- if page.authors or config.extra.show_reading_time -%}
<p>
<small>
{%- if page.authors -%}
<span>{% include "partials/authors.html" -%}</span>
{%- if config.extra.show_reading_time -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
{%- if config.extra.show_reading_time -%}
<span>{{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }}</span>
{%- if page.taxonomies -%}
<span> {{ config.extra.separator | default(value="•") }} </span>
{%- endif -%}
{%- endif -%}
</small>
</p>
{%- endif -%}
{%- if page.taxonomies -%}
{%- for name, taxon in page.taxonomies %}
<ul class="tags">
{%-for item in taxon -%}
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
{%- endfor %}
</ul>
{%- endfor -%}
{%- endif %}
</div>
<div id="buttons-container">
{%- if page.extra.toc and page.toc | length > 0 -%}
<details id="toc" class="closable">
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
<div>
<{{ list_element }}>
{%- for h1 in page.toc -%}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{%- if h1.children -%}
<{{ list_element }}>
{%- for h2 in h1.children -%}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{%- endfor -%}
</{{ list_element }}>
{%- endif -%}
</li>
{%- endfor -%}
</{{ list_element }}>
</div>
</div>
</details>
{%- endif -%}
{%- if config.extra.show_backlinks and page.backlinks | length > 0 -%}
<details id="backlinks" class="closable">
<summary title="{{ macros_translate::translate(key='backlinks', default='Backlinks', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
<strong class="title">{{ macros_translate::translate(key="backlinks", default="Backlinks", language_strings=language_strings) }}</strong>
<div>
<ul>
{%- for backlink in page.backlinks -%}
<li>
<a href="{{ backlink.permalink }}">{{ backlink.title }}</a>
</li>
{%- endfor -%}
</ul>
</div>
</div>
</details>
{%- endif -%}
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- if config.extra.show_share_button -%}
<a id="share" href="https://shareopenly.org/share/?url={{ page.permalink }}{% if page.description %}&text={{ page.description | urlencode }}{% endif %}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='share', default='Share', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
{%- if config.extra.issues_url -%}
<a id="issue" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='file_an_issue', default='File an Issue', language_strings=language_strings) }}"><i class="icon"></i></a>
{%- endif -%}
</div>
{%- include "partials/statements.html" -%}
{%- if page.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- elif config.extra.toc_inline -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ page.content | safe }}
{% include "partials/banner.html" %}
{% include "partials/article_content.html" %}
</article>
{%- if page.extra.comments.id -%}

View File

@ -43,24 +43,6 @@
</p>
{% include "partials/subprojects.html" %}
{% include "partials/paginator.html" %}
{%- if paginator.pages -%}
<nav id="paginator">
{%- if paginator.previous -%}
<a id="paginator-previous" href="{{ paginator.previous }}">
<i class="icon"></i>
<div>{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}</div>
</a>
{%- endif -%}
<div></div>
{%- if paginator.next -%}
<a id="paginator-next" href="{{ paginator.next }}">
<div>{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}</div>
<i class="icon"></i>
</a>
{%- endif -%}
</nav>
{%- endif -%}
{% endblock content %}