diff --git a/README.md b/README.md index b8fc4b7..3eeb6d5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Terminimal [![Build Status](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment) @@ -12,6 +13,7 @@ Tested with Zola v0.19.2. Please note that earlier (and older) versions might not work because of breaking changes across Zola versions. + #### Fork disclaimer This theme is a fork (not a port) of "Terminal" Hugo theme @@ -23,6 +25,37 @@ Many thanks for that outstanding original theme, Radek! For more information about this fork and the differences to the original theme, please see: [Changes compared to the original theme](#changes-compared-to-the-original-theme) below. + +## Table of contents + +- [Versioning](#versioning) +- [How to start](#how-to-start) +- [Shortcodes](#shortcodes) + - [`image`](#image) + - [`figure`](#figure) +- [Features](#features) + - [OpenGraph](#opengraph) + - [Mastodon](#mastodon) +- [Configuration](#configuration) + - [Only show the post's description](#only-show-the-posts-description) + - [Colors](#colors) + - [Logo text and link](#logo-text-and-link) + - [Author and copyright](#author-and-copyright) + - [Menu](#menu) + - [Tags](#tags) + - [Pagination](#pagination) + - [Language code](#language-code) + - [Hack font subset](#hack-font-subset) + - [Favicon](#favicon) + - [Page titles](#page-titles) +- [Extending](#extending) +- [How to contribute](#how-to-contribute) +- [Changes compared to the original theme](#changes-compared-to-the-original-theme) + - [New features](#new-features) + - [Features retained from the original](#features-retained-from-the-original) +- [License](#license) + + ## Versioning This theme used to be non-versioned, e.g. you'd pull the master branch, and occasionally new features or fixes would @@ -83,7 +116,7 @@ Example: {{ image(src="/img/hello.png", alt="Hello Friend", position="left", style="border-radius: 8px;") }} ``` - + ### `figure` Same as `image`, but with a few extra optional arguments: @@ -103,7 +136,9 @@ Example: caption_style="font-style: italic;") }} ``` -## OpenGraph +## Features + +### OpenGraph To add an image to a post, set the `og_image` extra option to the desired image in the same directory of the markdown file: @@ -121,6 +156,16 @@ Additionally, for the section pages and for posts to have a fallback image, add default_og_image = "static/ocean.jpg" ``` +### Mastodon + +To enable [Mastodon verification](https://docs.joinmastodon.org/user/profile/#verification), add +the following to your `config.toml`: + +```toml +[extra] +mastodon_url = "https://hachyderm.io/@opeik" +``` + ## Configuration ### Only show the post's description @@ -189,7 +234,7 @@ You can set the footer's copyright author name like this: # copyright text. Apart from author, it will # contain current year and a link to the theme. author = "My Name" -``` +``` If you don't like the default copyright text, you can set it to completely custom HTML: @@ -218,13 +263,13 @@ menu_items = [ # each of these is optional, name and url are required # $BASE_URL is going to be substituted by base_url from configuration {name = "blog", url = "$BASE_URL"}, - + # tags should only be enabled if you have "tags" taxonomy # see documentation below for more details {name = "tags", url = "$BASE_URL/tags"}, {name = "archive", url = "$BASE_URL/archive"}, {name = "about me", url = "$BASE_URL/about"}, - + # set newtab to true to make the link open in new tab {name = "github", url = "url-to-your-github", newtab = true}, ] @@ -241,7 +286,7 @@ taxonomies = [ ] ``` -Enabling tags will create a new `/tags` page, and +Enabling tags will create a new `/tags` page, and cause them to show up in `archive` section. Note that you still need to create a menu link to the tags page manually. @@ -428,3 +473,5 @@ for more information. The license for Hack fonts used is included in [LICENSE-Hack.md](../master/LICENSE-Hack.md). + +[utterances]: https://utteranc.es/ diff --git a/templates/index.html b/templates/index.html index fd07b4c..d2bf2b0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -30,6 +30,10 @@ {% endif -%} + {%- if config.extra.mastodon_url %} + {%- block mastodon %}{{ head_macros::mastodon(config=config) }}{% endblock mastodon -%} + {% endif -%} + {%- block extra_head %} {% endblock extra_head -%} diff --git a/templates/macros/head.html b/templates/macros/head.html index d882e0c..5451756 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -92,3 +92,7 @@ {% endmacro open_graph %} + +{% macro mastodon(config) %} + +{% endmacro mastodon %}