From aa00640e96a6e0934e7792f384f09ec476f3bdb7 Mon Sep 17 00:00:00 2001 From: welpo Date: Wed, 22 Feb 2023 23:56:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20use=20custom=20separator=20?= =?UTF-8?q?from=20config=20in=20meta=20&=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 7 +++++-- templates/macros/content.html | 4 +++- templates/macros/set_title.html | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 6f46829..d9fe76d 100644 --- a/config.toml +++ b/config.toml @@ -20,10 +20,13 @@ use_cdn = false date_format = "" # If unset, uses format: "1st January 2049" -#Full path after the base URL required. So if you were to place it in "static" it would be "/favicon.ico" +# Custom separator used in title tag and posts metadata (between date, time to read, and tags). +separator = "•" + +# Full path after the base URL required. So if you were to place it in "static" it would be "/favicon.ico" favicon = "" -#This header image is used for SEO. For example if you were to share an image via Messenger/Instagram/Twitter a preview picture is also presented +# This header image is used for SEO. For example if you were to share an image via Messenger/Instagram/Twitter a preview picture is also presented headerImage = "" # The icon is display besides the menu text but is not necessary. It needs to be placed under "menu_icon" in the static "folder" diff --git a/templates/macros/content.html b/templates/macros/content.html index 47b1561..8e4d4d9 100644 --- a/templates/macros/content.html +++ b/templates/macros/content.html @@ -1,4 +1,6 @@ -{% macro content(page, separator='•') %} +{% macro content(page) %} +{% set separator = config.extra.separator | default(value="•") %} +
diff --git a/templates/macros/set_title.html b/templates/macros/set_title.html index 1f60933..c91ffaf 100644 --- a/templates/macros/set_title.html +++ b/templates/macros/set_title.html @@ -2,7 +2,8 @@ {# Setup. #} {% set prefix = config.title | safe %} -{% set separator = " • " %} +{% set custom_separator = config.extra.separator | default(value="•") %} +{% set separator = " " ~ custom_separator ~ " " %} {% if current_path and current_path == "/" %} {% set suffix = "" %}