Adjust post meta format and move tags to post listing

- Remove showing of tags completely on gemini. I didn't find any good
  place to put it
- List of tags are now shown in post listing with its display muted but
  known as links
- Changelog is removed as I didn't find a good place to put it
- Made the "EOF" optional through post params with self-documenting
  frontmatter adjusted in archetypes
- Explicit date format in archetypes
- Better formatting of post meta information in both WWW and gemini
This commit is contained in:
hedy 2024-04-11 15:16:01 +08:00
parent 9cdfd7749a
commit 7346846c71
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
11 changed files with 41 additions and 43 deletions

View File

@ -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 }}

View File

@ -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
+++

View File

@ -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);
}

View File

@ -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

View File

@ -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 -}}

View File

@ -1,5 +1,4 @@
{{ if lt .Date .Lastmod -}}
 | 
Last updated on
<time itemprop="dateModified" class="dt-updated">{{ .Lastmod.Format "2006-01-02" }}</time>
{{ if lt .Page.Date .Page.Lastmod -}}
{{ .Prefix | safeHTML }}Last updated on
<time itemprop="dateModified" class="dt-updated">{{ .Page.Lastmod.Format "Jan 2, 2006" }}</time>
{{- end -}}

View File

@ -29,7 +29,10 @@
{{ else -}}
</h3>
{{ end -}}
<p class="post-meta"><time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time></p>
<p class="post-meta">
<time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "Jan 02, 2006" }}</time>
&nbsp;·&nbsp; {{ partial "tags.html" . }}
</p>
<p class="desc">{{ .Description }}</p>
</li>
{{- end }}

View File

@ -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 }}

View File

@ -1,7 +1,5 @@
{{ $taxonomy := "tags" -}}
{{ with .Param $taxonomy -}}
&nbsp;|&nbsp;
Tagged
{{ with .Param $taxonomy -}}<span class="tags">
{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}<a href="{{ .RelPermalink }}">{{ $tag | urlize }}</a>{{- end -}}{{- end }}
{{- end -}}
</span>{{- end -}}

View File

@ -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

View File

@ -3,19 +3,14 @@
<article itemprop="mainEntityOfPage">
<header id="post-header">
<h1 itemprop="name headline" class="p-name">{{ .Title }}</h1>
{{ with .Description -}}
<div class="post-description"><p>{{ . }}</p></div>
{{- end }}
<div class="post-meta">
<p>Posted on
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
{{ partial "tags.html" . }}
{{ partial "lastmod.html" . }}
&nbsp;|&nbsp;
<a href="{{ .Site.Params.logURLPrefix }}content/{{ .File.Path }}">Changelog</a>
<p>
<time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "Jan 02, 2006" }}</time>
{{ partial "lastmod.html" (dict "Page" . "Prefix" "&nbsp;·&nbsp;" ) }}
&nbsp;·&nbsp; {{ .WordCount }} words
</p>
<hr>
</div>
<hr>
</header>
<section class="e-content" itemprop="articlebody">
{{ partial "processed-content" . -}}
@ -24,7 +19,7 @@
</div>
{{- end }}
{{- define "after" }}
<p id="#EOF">EOF</p>
{{ if (eq .Params.EOF false) }}{{ else }}<p id="#EOF">EOF</p>{{ end }}
<section class="comments">
<p>
Questions, comments? Send an email to my