diff options
author | Yann Herklotz <git@yannherklotz.com> | 2023-05-11 19:38:03 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2023-05-11 19:38:03 +0100 |
commit | 47c1289ff658a5aec71635d79ffe30bb29a07876 (patch) | |
tree | 56cf6b959e37fed88c492d34defd3d7ec40e7148 /layouts | |
parent | fbe0fc62120348f582dc4db2b614078943d0764b (diff) | |
download | zk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.tar.gz zk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.zip |
Add content
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 17 | ||||
-rw-r--r-- | layouts/_default/single.html | 30 | ||||
-rw-r--r-- | layouts/partials/head_custom.html | 19 | ||||
-rw-r--r-- | layouts/partials/post-element.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-1.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-2.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/transclude-3.html | 4 |
7 files changed, 82 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..744f390 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ partial "header.html" . }} + +{{if not .IsHome }} +<h1>{{ .Title | markdownify }}</h1> +{{ end }} + +{{ .Content }} + +<ul> + {{ $pages := .Pages }} + {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }} + {{ range (where $pages "Section" "!=" "") }} + {{ partial "post-element.html" . }} + {{ end }} +</ul> + +{{ partial "footer.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..f3953af --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,30 @@ +{{ partial "header.html" . }} +<div class="article-meta"> +<h1><span class="title">{{ .Title | markdownify }}</span></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> + +<main> +{{ .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 }} + {{ 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 }} + {{ end }} + +{{ partial "footer.html" . }} diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html new file mode 100644 index 0000000..47ba699 --- /dev/null +++ b/layouts/partials/head_custom.html @@ -0,0 +1,19 @@ +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous"> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.js" integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t" crossorigin="anonymous"></script> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script> +<script> + document.addEventListener("DOMContentLoaded", function() { + renderMathInElement(document.body, { + // customised options + // • auto-render specific keys, e.g.: + delimiters: [ + {left: '$$', right: '$$', display: true}, + {left: '$', right: '$', display: false}, + {left: '\\(', right: '\\)', display: false}, + {left: '\\[', right: '\\]', display: true} + ], + // • rendering keys, e.g.: + throwOnError : false + }); + }); +</script> diff --git a/layouts/partials/post-element.html b/layouts/partials/post-element.html new file mode 100644 index 0000000..b45a1e1 --- /dev/null +++ b/layouts/partials/post-element.html @@ -0,0 +1,4 @@ +<li> + <span class="date">{{ .Date.Format "2006/01/02" }}</span> + <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> +</li> diff --git a/layouts/shortcodes/transclude-1.html b/layouts/shortcodes/transclude-1.html new file mode 100644 index 0000000..80a24da --- /dev/null +++ b/layouts/shortcodes/transclude-1.html @@ -0,0 +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> + {{ .Inner | markdownify }} +</div> diff --git a/layouts/shortcodes/transclude-2.html b/layouts/shortcodes/transclude-2.html new file mode 100644 index 0000000..a63de87 --- /dev/null +++ b/layouts/shortcodes/transclude-2.html @@ -0,0 +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> + {{ .Inner | markdownify }} +</div> diff --git a/layouts/shortcodes/transclude-3.html b/layouts/shortcodes/transclude-3.html new file mode 100644 index 0000000..1e43c85 --- /dev/null +++ b/layouts/shortcodes/transclude-3.html @@ -0,0 +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> + {{ .Inner | markdownify }} +</div> |