From 988034ba4ebf622d3e704cfee7a2bd681abcf306 Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 6 Feb 2023 14:42:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20set=20datetime?= =?UTF-8?q?=20format=20as=20a=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 5 ++++- templates/macros/macros.html | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config.toml b/config.toml index 071f5ec..dd3b205 100644 --- a/config.toml +++ b/config.toml @@ -18,6 +18,8 @@ highlight_theme = "css" toc = true use_cdn = false +timeformat = "%d %B %Y" # Default format: "31 January 2049" + #Full path after the base URL required. So if you were to place it in "static" it would be "/favicon.ico" favicon = "" @@ -30,6 +32,7 @@ menu = [ { name = "tags", url = "$BASE_URL/tags" }, { name = "projects", url = "$BASE_URL/projects" }, ] + #The icons available can be found in "social_icons" in the "static" folder socials = [ { name = "github", url = "$BASE_URL/atom.xml", icon = "rss" }, @@ -38,4 +41,4 @@ socials = [ { name = "instagram", url = "https://instagram.com/oskerwyld", icon = "instagram" }, { name = "youtube", url = "https://youtube.com/@oskerwyld", icon = "youtube" }, { name = "spotify", url = "https://open.spotify.com/artist/5Hv2bYBhMp1lUHFri06xkE", icon = "spotify" }, -] \ No newline at end of file +] diff --git a/templates/macros/macros.html b/templates/macros/macros.html index b865fab..6d69a70 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -8,7 +8,7 @@
{%- if page.date %} - {{ page.date | date(format="%d %B %Y") }} + {{ page.date | date(format=config.extra.timeformat) }} {% endif -%}
{{ page.reading_time }} minute read @@ -86,7 +86,7 @@
{% if page.date %} - Posted on {{ page.date | date(format="%d %B %Y") }} + Posted on {{ page.date | date(format=config.extra.timeformat) }} ~ {% endif %} {{ page.reading_time }} minute read @@ -182,7 +182,7 @@
{%- if page.date %} - {{ page.date | date(format="%d %B %Y") }} + {{ page.date | date(format=config.extra.timeformat) }} {% endif -%} {% if page.draft %} DRAFT @@ -212,7 +212,7 @@ {% for page in pages %}
  • {{ page.title }} - {{ page.date | date(format="%d %B %Y") }} + {{ page.date | date(format=config.extra.timeformat) }}
  • {% endfor %}