diff options
author | Yann Herklotz <git@yannherklotz.com> | 2023-05-12 15:26:18 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2023-05-12 15:26:18 +0100 |
commit | 91c696fc52ffb1eeb894328c722ba4473c8027c1 (patch) | |
tree | acad0a25bbbfc198aab3f0f7a7068471d26c7756 /layouts | |
parent | fbca1f08c0de7413519931e134ee0ef48f408ade (diff) | |
download | zk-web-91c696fc52ffb1eeb894328c722ba4473c8027c1.tar.gz zk-web-91c696fc52ffb1eeb894328c722ba4473c8027c1.zip |
Update themes and add content
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 9 | ||||
-rw-r--r-- | layouts/_default/single.html | 34 | ||||
-rw-r--r-- | layouts/partials/head_custom.html | 1 | ||||
-rw-r--r-- | layouts/partials/post-element.html | 8 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-1.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-2.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-3.html | 2 |
7 files changed, 33 insertions, 25 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 744f390..4cf7dd1 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -6,12 +6,15 @@ {{ .Content }} -<ul> {{ $pages := .Pages }} {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} - {{ range (where $pages "Section" "!=" "") }} + {{ range $pages.GroupByDate "2006" }} + <h2 class="post-year">{{ .Key }}</h2> + <table class="post-list"> + {{ range .Pages }} {{ partial "post-element.html" . }} {{ end }} -</ul> + </table> + {{ end }} {{ partial "footer.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f3953af..e1f98a7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,6 @@ {{ partial "header.html" . }} <div class="article-meta"> -<h1><span class="title">{{ .Title | markdownify }}</span></h1> +<h1><span class="title">{{ .Title | markdownify }}</span>{{ if .Params.zettelid }}<a class="zettel-link" href="{{ .RelPermalink }}"> [#{{ .Params.zettelid }}]</a>{{ end }}</h1> <!--{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}--> {{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }} </div> @@ -9,22 +9,26 @@ {{ .Content }} </main> - {{ if (.Page.Param "backlinks") }} - <h2>Referenced from</h2> - {{ range (.Page.Param "backlinks") }} - {{ with ($.Site.GetPage (printf "/zettel/%s" .)) }} - {{ partial "post-element.html" . }} - {{- end }} - {{ end }} +{{ with (.Page.Param "backlinks") }} +<h2>Referenced from</h2> +<table class="post-list"> +{{ range . }} + {{ with ($.Site.GetPage (printf "/zettel/%s" .)) }} + {{ partial "post-element" . }} {{ end }} +{{ end }} +</table> +{{ end }} - {{ if (.Page.Param "forwardlinks") }} - <h2>Links to</h2> - {{ range (.Page.Param "forwardlinks") }} - {{ with ($.Site.GetPage (printf "/zettel/%s" .)) }} - {{ partial "post-element.html" . }} - {{- end }} - {{ end }} +{{ with (.Page.Param "forwardlinks") }} +<h2>Links to</h2> +<table class="post-list"> +{{ range . }} + {{ with ($.Site.GetPage (printf "/zettel/%s" .)) }} + {{ partial "post-element" . }} {{ end }} +{{ end }} +</table> +{{ end }} {{ partial "footer.html" . }} diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html index 47ba699..93e3874 100644 --- a/layouts/partials/head_custom.html +++ b/layouts/partials/head_custom.html @@ -17,3 +17,4 @@ }); }); </script> +<link rel="stylesheet" href="{{ "css/custom.css" | relURL }}" /> diff --git a/layouts/partials/post-element.html b/layouts/partials/post-element.html index b45a1e1..28fff85 100644 --- a/layouts/partials/post-element.html +++ b/layouts/partials/post-element.html @@ -1,4 +1,4 @@ -<li> - <span class="date">{{ .Date.Format "2006/01/02" }}</span> - <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> -</li> +<tr> + <td>{{ .Title | markdownify }}{{ if .Params.zettelid }}<a class="zettel-link" href="{{ .RelPermalink }}"> [#{{ .Params.zettelid }}]</a>{{ end }}</td> + <td class="date-td">{{ with .Date }}<span class="date">{{ .Format "2006/01/02" }}</span>{{ end }}</td> +</tr> diff --git a/layouts/shortcodes/transclude-1.html b/layouts/shortcodes/transclude-1.html index 80a24da..cfc6a86 100644 --- a/layouts/shortcodes/transclude-1.html +++ b/layouts/shortcodes/transclude-1.html @@ -1,4 +1,4 @@ <div class="transclude-1"> - <h2><a class="transclude-link" href="/zettel/{{ .Get "zettel" }}">{{ .Get "zettel" }}: {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}{{ .Title | markdownify }}{{ end }}</a></h2> + {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}<h2>{{ .Title | markdownify }}<a class="transclude-link" href="{{ .RelPermalink }}"> [#{{ .Params.zettelid }}]</a></h2>{{ end }} {{ .Inner | markdownify }} </div> diff --git a/layouts/shortcodes/transclude-2.html b/layouts/shortcodes/transclude-2.html index a63de87..20987ae 100644 --- a/layouts/shortcodes/transclude-2.html +++ b/layouts/shortcodes/transclude-2.html @@ -1,4 +1,4 @@ <div class="transclude-2"> - <h3><a class="transclude-link" href="/zettel/{{ .Get "zettel" }}">{{ .Get "zettel" }}: {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}{{ .Title | markdownify }}{{ end }}</a></h3> + {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}<h3>{{ .Title | markdownify }}<a class="transclude-link" href="{{ .RelPermalink }}"> [#{{ .Params.zettelid }}]</a></h3>{{ end }} {{ .Inner | markdownify }} </div> diff --git a/layouts/shortcodes/transclude-3.html b/layouts/shortcodes/transclude-3.html index 1e43c85..6e73cd4 100644 --- a/layouts/shortcodes/transclude-3.html +++ b/layouts/shortcodes/transclude-3.html @@ -1,4 +1,4 @@ <div class="transclude-3"> - <h4><a class="transclude-link" href="/zettel/{{ .Get "zettel" }}">{{ .Get "zettel" }}: {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}{{ .Title | markdownify }}{{ end }}</a></h4> + {{ with ($.Site.GetPage (printf "/zettel/%s" (.Get "zettel"))) }}<h4>{{ .Title | markdownify }}<a class="transclude-link" href="{{ .RelPermalink }}"> [#{{ .Params.zettelid }}]</a></h4>{{ end }} {{ .Inner | markdownify }} </div> |