11 Commits

Author SHA1 Message Date
b09f47aae7 fix showLastUpdate #503 2024-11-22 19:19:48 +01:00
c779a70834 Add configurable timestamping for posts (#494)
* Add configurable timestamping

* Add attribution for configurable timestamping

* Add new post timestamp options to example hugo.toml

* All date formats are now set by single config option in site or page config

* Add post timestamp explainer and examples to example config file

* Add configurable timestamping value to frontmatter archetype

* Explain possible timezone rendering issue with new time formatting

* Fix bug concerning time/date tokens

* Convert datestamps to work with a partial

* Fix issue with lastmod being equal to date

* Add Updated prefix functionality
2024-11-19 09:09:43 +01:00
08ec931cea update tn cover 2024-11-11 09:02:41 +01:00
929ed76012 fix USESRS.md 2024-11-11 09:02:03 +01:00
9782532893 Add katiethe.dev to USERS.md 2024-10-26 12:13:55 -06:00
7f7e4ce21b Merge pull request #491 from carm4ris/patch-1
Update USERS.md
2024-10-25 22:26:32 +02:00
32cc685144 Merge branch 'master' into patch-1 2024-10-25 22:26:21 +02:00
a11eebeb10 Merge pull request #490 from ragonneau/master
Update USERS.md
2024-10-25 22:25:47 +02:00
ccc11bb362 Update USERS.md 2024-10-24 16:19:43 +02:00
166fbb7dbc Update USERS.md 2024-10-22 09:28:00 +02:00
6802c6eebf fix zero 2024-10-16 10:22:19 +02:00
11 changed files with 53 additions and 7 deletions

View File

@ -27,3 +27,8 @@ eg:
- **Support for beautiful *KaTeX* formulae** ([amtoine/hugo-theme-terminal-katex](https://github.com/amtoine/hugo-theme-terminal-katex))
- SHORT DESCRIPTION
- Antoine Stevan ([@amtoine](https://github.com/amtoine)), software engineer into open source
- **Configurable timestamping for posts** ([KatieTheDev/hugo-theme-terminal](https://github.com/KatieTheDev/hugo-theme-terminal))
- Allows for configuring timestamping, not just datestamping
- Works with last modification dates as well
- KatieTheDev ([@KatieTheDev](https://github.com/KatieTheDev))

View File

@ -203,6 +203,20 @@ paginate = 5
# can be overridden in a page's front-matter
# TocTitle = "Table of Contents" # default
# Set date/time format for posts
# This will impact the date/time displayed on
# index.html, the posts list page, and on posts themselves
# This value can also be configured per-post on front matter
# If you have any issues with the timezone rendering differently
# than you expected, please ensure your timezone is correctly set
# on your server.
# This value can be customized according to Hugo documentation:
# https://gohugo.io/functions/time/format/
# Default value (no changes needed):
# dateFormat = "2006-01-02"
# Example format, with date, time, and timezone abbreviation:
# dateFormat = "2006-01-02 3:04:06 PM MST"
[params.twitter]
# set Twitter handles for Twitter cards

View File

@ -59,6 +59,11 @@
- https://www.sagbot.com **E. HADDAG** (Computer Scientist)
- https://adamperkowski.dev **Adam Perkowski** (A Random Developer)
- https://imortio.github.io **Azrul** (CompSci Student)
- https://carmar.is **Carmaris** (Amateur Hacker)
- https://ragonneau.github.io **Tom Ragonneau** (Engineer)
- https://katiethe.dev **KatieTheDev** (Amateur porgrammer and tinkerer)
- https://stefka.eu **Jiří Štefka** (Software Developer)
<!--
TEMPLATE:
@ -66,3 +71,4 @@
-->

View File

@ -1,6 +1,7 @@
+++
title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = "{{ .Date }}"
#dateFormat = "2006-01-02" # This value can be configured for per-post date formatting
author = ""
authorTwitter = "" #do not include @
cover = ""

View File

@ -4,7 +4,7 @@
font-style: normal;
font-weight: 400;
src: url("../fonts/FiraCode-Regular.woff") format("woff");
font-feature-settings: "liga", "tnum", "zero", "ss01", "locl";
font-feature-settings: "liga", "tnum", "ss01", "locl";
font-variant-ligatures: contextual;
}
@ -14,6 +14,6 @@
font-style: normal;
font-weight: 800;
src: url("../fonts/FiraCode-Bold.woff") format("woff");
font-feature-settings: "liga", "tnum", "zero", "ss01", "locl";
font-feature-settings: "liga", "tnum", "ss01", "locl";
font-variant-ligatures: contextual;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -23,7 +23,7 @@
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- .Date.Format "2006-01-02" -}}
{{- partial "post-date" . -}}
</time>
{{- end -}}
{{- with .Params.Author -}}

View File

@ -13,7 +13,7 @@
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- .Date.Format "2006-01-02" -}}
{{- partial "post-date" . -}}
</time>
{{- end -}}
{{- with .Params.Author -}}

View File

@ -6,9 +6,9 @@
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- .Date.Format "2006-01-02" -}}
{{- if $.Site.Params.showLastUpdated -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated" -}} :: {{- .Lastmod.Format "2006-01-02" -}}]
{{- partial "post-date" . -}}
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
&nbsp;{{- partial "post-lastmod" . -}}
{{- end -}}
</time>
{{- end -}}

View File

@ -0,0 +1,10 @@
{{- $date := .Date -}}
{{- with .Params.dateFormat -}}
{{- $date | time.Format . -}}
{{- else -}}
{{- with .Site.Params.dateFormat -}}
{{- $date | time.Format . -}}
{{- else -}}
{{- $date | time.Format "2006-01-02" -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,10 @@
{{- $date := .Lastmod -}}
{{- with .Params.dateFormat -}}
{{- $date | time.Format . -}}
{{- else -}}
{{- with .Site.Params.dateFormat -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format . -}}]
{{- else -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated: " }} {{ $date | time.Format "2006-01-02" -}}]
{{- end -}}
{{- end -}}