diff --git a/archetypes/default.md b/archetypes/default.md index 22035b0..0f3354b 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,6 +1,6 @@ +++ -title = "{{ replace .Name "-" " " | title }}" -date = {{ .Date }} +title = '{{ replace .Name '-' ' ' | title }}' +date = {{ .Date.Format "2006-01-02" }} draft = true outputs = ['html', 'gemtext'] slug = {{ .Name }} diff --git a/archetypes/posts.md b/archetypes/posts.md index fa369fb..554885b 100644 --- a/archetypes/posts.md +++ b/archetypes/posts.md @@ -5,10 +5,14 @@ description = {{ strings.FirstUpper $title }} highlight = false draft = true -date = {{ .Date }} +date = {{ .Date.Format "2006-01-02T15:04:05Z" }} draft = true outputs = ['html', 'gemtext'] +# Filename after the date slug = {{ slicestr .Name 11 }} +# The "EOF" after the hr at the end of a post. +# Generally: disable if footnotes are used, enable otherwise to signify the end. +EOF = true +++ diff --git a/assets/main.css b/assets/main.css index 57e4091..6af37c3 100644 --- a/assets/main.css +++ b/assets/main.css @@ -154,19 +154,23 @@ nav .pfp-text { } /* Differentiating between normal content links and meta content links */ -.meta a, .post-meta a, footer a, #after-content a { +.meta a, .post-meta :not(.tags) a, footer a, #after-content a { text-decoration: none; @media (prefers-color-scheme: dark) { color: var(--link-alt); } } -.meta a:hover, .post-meta a:hover, footer a:hover, #after-content a:hover { +.meta a:hover, .post-meta :not(.tags) a:hover, footer a:hover, #after-content a:hover { color: var(--accent-light); text-decoration: underline; @media (prefers-color-scheme: dark) { opacity: .75; } } +.post-meta .tags a, .post-meta .tags a:visited { + text-decoration: underline; + color: var(--text-light); +} nav a { text-decoration: none; @@ -546,7 +550,7 @@ a.anchor:hover { #post-header { margin-bottom: 2rem; } -.post-meta, .meta, footer, #after-content, .post-description { +.post-meta, .meta, footer, #after-content { font-size: .9rem; color: var(--text-light); } diff --git a/content/posts/2024-04-10-vim-column-editing/index.md b/content/posts/2024-04-10-vim-column-editing/index.md index 2ce4472..d1f6694 100644 --- a/content/posts/2024-04-10-vim-column-editing/index.md +++ b/content/posts/2024-04-10-vim-column-editing/index.md @@ -7,6 +7,7 @@ outputs = ['html', 'gemtext'] slug = 'vim-column-editing' tags = ['howto'] title = 'Vim visual block mode for column editing' +EOF = false +++ The visual block mode in Vim lets you edit text simultaneously across adjacent diff --git a/layouts/partials/lastmod.gmi b/layouts/partials/lastmod.gmi new file mode 100644 index 0000000..3a385ee --- /dev/null +++ b/layouts/partials/lastmod.gmi @@ -0,0 +1,2 @@ +{{ $lastmod := .Page.Lastmod -}} +{{- if lt .Page.Date $lastmod }}{{ with .Prefix }}{{ . }}{{ end }}Last updated on {{ $lastmod.Format "Jan 02, 2006" }}{{ with .Postfix }}{{ . }}{{ end }}{{ end -}} diff --git a/layouts/partials/lastmod.html b/layouts/partials/lastmod.html index 50646fc..9ef3788 100644 --- a/layouts/partials/lastmod.html +++ b/layouts/partials/lastmod.html @@ -1,5 +1,4 @@ -{{ if lt .Date .Lastmod -}} -  |  - Last updated on - +{{ if lt .Page.Date .Page.Lastmod -}} + {{ .Prefix | safeHTML }}Last updated on + {{- end -}} diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index 9a869bd..b213195 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -29,7 +29,10 @@ {{ else -}} {{ end -}} -

+

+ +  ·  {{ partial "tags.html" . }} +

{{ .Description }}

{{- end }} diff --git a/layouts/partials/tags.gmi b/layouts/partials/tags.gmi new file mode 100644 index 0000000..006426e --- /dev/null +++ b/layouts/partials/tags.gmi @@ -0,0 +1,4 @@ +{{- $taxonomy := "tags" }} +{{- with .Param $taxonomy }} +Tagged{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} +{{- if $index -}}, {{ end -}}{{ if (not $index) }}{{ printf " " }}{{ end }}{{ $tag | urlize }}{{ end }}{{ end }}{{- end }} diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html index c24d936..964b4ef 100644 --- a/layouts/partials/tags.html +++ b/layouts/partials/tags.html @@ -1,7 +1,5 @@ {{ $taxonomy := "tags" -}} -{{ with .Param $taxonomy -}} -  |  - Tagged +{{ with .Param $taxonomy -}} {{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} {{- if $index -}}, {{ end -}}{{ $tag | urlize }}{{- end -}}{{- end }} -{{- end -}} +{{- end -}} diff --git a/layouts/posts/single.gmi b/layouts/posts/single.gmi index 8ddbce9..fb83ad5 100644 --- a/layouts/posts/single.gmi +++ b/layouts/posts/single.gmi @@ -1,28 +1,16 @@ {{ define "content" -}} # {{ $.Title }} -Posted {{ .Date.Format "2006-01-02" }} -{{- $lastmod := .Lastmod }} -{{- if lt .Date $lastmod }} -Last updated {{ .Lastmod.Format "2006-01-02" }} -{{- end }} -{{- $taxonomy := "tags" }} -{{- with .Param $taxonomy }} -{{- if gt (len .) 1 }} -Tags: -{{- else if gt (len .) 0 }} -Tag: -{{- end -}} - -{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} -{{- if $index -}}, {{ end -}}{{ if (not $index) }}{{printf " "}}{{end}}{{ $tag | urlize }}{{- end -}}{{- end }} -{{- end }} +{{ .Date.Format "Jan 02, 2006" }} · {{ .WordCount }} words +{{ partial "lastmod.gmi" (dict "Page" . "Postfix" ".") }} -- {{ partial "processed-content.gmi" . }} -- +{{- if (ne .Params.EOF false) }} +EOF +{{ end }} Questions/comments: - => mailto:~hedy/posts@lists.sr.ht Public gemlog mailing list (plain-text only) => mailto:{{ .Site.Author.email }} Or email me directly diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 08c99f7..5d8bdb8 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -3,19 +3,14 @@

{{ .Title }}

- {{ with .Description -}} -

{{ . }}

- {{- end }} -
{{ partial "processed-content" . -}} @@ -24,7 +19,7 @@ {{- end }} {{- define "after" }} -

EOF

+{{ if (eq .Params.EOF false) }}{{ else }}

EOF

{{ end }}

Questions, comments? Send an email to my