From 4b534dd48131b3e04336e61c66556afe59f5fc2a Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sat, 22 Feb 2025 20:01:22 +0100 Subject: Better tags --- templates/base.html | 2 ++ templates/index.html | 6 ++++-- templates/note.html | 6 +++++- templates/post.html | 9 ++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index 3fbaf8e..ff39b57 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,6 +20,8 @@ table { width: 100%; } figure { margin: 0; } .flow { max-width: 1100px; column-count: 2; column-gap: 1em; } + .tags { display: inline-flex; gap: 0.2em; padding-right: 0.2em; font-family: monospace; } + .tags mark { padding: 0 0.2em; font-size: small; } @media only screen and (max-width: 860px) { body { display: block; } main { margin: 1em 0; } diff --git a/templates/index.html b/templates/index.html index 57f9b40..be725f5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,8 +21,10 @@ {{ range .Pages }} {{ if and (not .Draft) (or (eq .Type "note") (eq .Type "post")) }}
  • - {{ if eq .Type "note" }} - {{ range .Meta.tags }}{{ . }}{{ end }} + {{ if .Meta.tags }} +
    + {{ range .Meta.tags }}{{ . }}{{ end }} +
    {{ end }} {{ .Title }}
  • diff --git a/templates/note.html b/templates/note.html index ce72921..62ac5f0 100644 --- a/templates/note.html +++ b/templates/note.html @@ -20,7 +20,11 @@ {{ range .Pages | filterbytype "note" | random 15 }} {{ if not .Draft }}
  • - {{ range .Meta.tags }}{{ . }}{{ end }} + {{ if .Meta.tags }} +
    + {{ range .Meta.tags }}{{ . }}{{ end }} +
    + {{ end }} {{ .Title }}
  • {{ end }} diff --git a/templates/post.html b/templates/post.html index 13feb66..4458e8f 100644 --- a/templates/post.html +++ b/templates/post.html @@ -19,7 +19,14 @@ {{ range .Pages | filterbytype "post" | random 15 }} {{ if not .Draft }} -
  • {{ .Title }}
  • +
  • + {{ if .Meta.tags }} +
    + {{ range .Meta.tags }}{{ . }}{{ end }} +
    + {{ end }} + {{ .Title }} +
  • {{ end }} {{ end }} -- cgit v1.2.3