♻️ refactor: set datetime format as a variable

main
welpo 2 years ago
parent 2cef2e5502
commit 988034ba4e

@ -18,6 +18,8 @@ highlight_theme = "css"
toc = true toc = true
use_cdn = false 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" #Full path after the base URL required. So if you were to place it in "static" it would be "/favicon.ico"
favicon = "" favicon = ""
@ -30,6 +32,7 @@ menu = [
{ name = "tags", url = "$BASE_URL/tags" }, { name = "tags", url = "$BASE_URL/tags" },
{ name = "projects", url = "$BASE_URL/projects" }, { name = "projects", url = "$BASE_URL/projects" },
] ]
#The icons available can be found in "social_icons" in the "static" folder #The icons available can be found in "social_icons" in the "static" folder
socials = [ socials = [
{ name = "github", url = "$BASE_URL/atom.xml", icon = "rss" }, { name = "github", url = "$BASE_URL/atom.xml", icon = "rss" },
@ -38,4 +41,4 @@ socials = [
{ name = "instagram", url = "https://instagram.com/oskerwyld", icon = "instagram" }, { name = "instagram", url = "https://instagram.com/oskerwyld", icon = "instagram" },
{ name = "youtube", url = "https://youtube.com/@oskerwyld", icon = "youtube" }, { name = "youtube", url = "https://youtube.com/@oskerwyld", icon = "youtube" },
{ name = "spotify", url = "https://open.spotify.com/artist/5Hv2bYBhMp1lUHFri06xkE", icon = "spotify" }, { name = "spotify", url = "https://open.spotify.com/artist/5Hv2bYBhMp1lUHFri06xkE", icon = "spotify" },
] ]

@ -8,7 +8,7 @@
<div class="meta"> <div class="meta">
{%- if page.date %} {%- if page.date %}
{{ page.date | date(format="%d %B %Y") }} {{ page.date | date(format=config.extra.timeformat) }}
{% endif -%} {% endif -%}
<br /> <br />
<span>{{ page.reading_time }} minute read</span> <span>{{ page.reading_time }} minute read</span>
@ -86,7 +86,7 @@
<div class="meta"> <div class="meta">
{% if page.date %} {% if page.date %}
Posted on {{ page.date | date(format="%d %B %Y") }} Posted on {{ page.date | date(format=config.extra.timeformat) }}
~ ~
{% endif %} {% endif %}
<span> {{ page.reading_time }} minute read</span> <span> {{ page.reading_time }} minute read</span>
@ -182,7 +182,7 @@
<div class="meta"> <div class="meta">
{%- if page.date %} {%- if page.date %}
{{ page.date | date(format="%d %B %Y") }} {{ page.date | date(format=config.extra.timeformat) }}
{% endif -%} {% endif -%}
{% if page.draft %} {% if page.draft %}
<span class="draft-label">DRAFT</span> <span class="draft-label">DRAFT</span>
@ -212,7 +212,7 @@
{% for page in pages %} {% for page in pages %}
<li class="post"> <li class="post">
<a href="{{ page.permalink }}">{{ page.title }}</a> <a href="{{ page.permalink }}">{{ page.title }}</a>
<span class="meta">{{ page.date | date(format="%d %B %Y") }}</span> <span class="meta">{{ page.date | date(format=config.extra.timeformat) }}</span>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

Loading…
Cancel
Save