From 7016e2a4f7a7e4902524545203994d29747134c4 Mon Sep 17 00:00:00 2001 From: Ben Charlton <ben@spod.cx> Date: Sun, 14 Apr 2024 13:19:10 +0100 Subject: [PATCH] add blog and recipe layouts --- layouts/blog/list.html | 15 +++++++++++++++ layouts/blog/single.html | 29 +++++++++++++++++++++++++++++ layouts/recipes/list.html | 12 ++++++++++++ layouts/recipes/single.html | 24 ++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 layouts/blog/list.html create mode 100644 layouts/blog/single.html create mode 100644 layouts/recipes/list.html create mode 100644 layouts/recipes/single.html diff --git a/layouts/blog/list.html b/layouts/blog/list.html new file mode 100644 index 0000000..917ca38 --- /dev/null +++ b/layouts/blog/list.html @@ -0,0 +1,15 @@ +{{ define "main" -}} +<ul class="posts"> + <h1>{{ .Title }}</h1> + {{ range .Data.Pages -}} + <li> + <div class="flex"> + <a href="{{ .Permalink }}" class="truncate">{{ .Title }}</a> + {{ if eq .Kind "page" }} + <time class="nowrap" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time> + {{ end }} + </div> + </li> + {{- end }} +</ul> +{{- end }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html new file mode 100644 index 0000000..384a538 --- /dev/null +++ b/layouts/blog/single.html @@ -0,0 +1,29 @@ +{{ define "main" -}} +<div class="post"> + <h1 class="title">{{ .Title }}</h1> + {{ with .Params.tagline }}<span class="tagline">{{ . }}</span>{{ end }} + + {{ if ne .Type "page" -}} + <div class="post-date"> + <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time> + </div> + {{- end }} + + <div> + {{ .Content }} + </div> + + {{ partial "tags.html" . }} + + {{ if (and (ne .Params.DisableShare true) (ne .Params.disable_share true)) -}} + {{ partial "share.html" . }} + {{- end }} + + {{ if (and .Site.Config.Services.Disqus.Shortname (ne .Params.DisableComments true) (ne .Params.disable_comments true)) -}} + <div class="comments"> + <h2>Comments</h2> + {{ template "_internal/disqus.html" . }} + </div> + {{- end }} +</div> +{{- end }} diff --git a/layouts/recipes/list.html b/layouts/recipes/list.html new file mode 100644 index 0000000..7794071 --- /dev/null +++ b/layouts/recipes/list.html @@ -0,0 +1,12 @@ +{{ define "main" -}} +<ul class="posts"> + <h1>{{ .Title }}</h1> + {{ range .Data.Pages.ByTitle -}} + <li> + <div class="flex"> + <a href="{{ .Permalink }}" class="truncate">{{ .Title }}</a> + </div> + </li> + {{- end }} +</ul> +{{- end }} diff --git a/layouts/recipes/single.html b/layouts/recipes/single.html new file mode 100644 index 0000000..b034420 --- /dev/null +++ b/layouts/recipes/single.html @@ -0,0 +1,24 @@ +{{ define "main" -}} +<div class="post"> + <h1 class="title">{{ .Title }}</h1> + {{ with .Params.tagline }}<span class="tagline">{{ . }}</span>{{ end }} + + + <div> + {{ .Content }} + </div> + + {{ partial "tags.html" . }} + + {{ if (and (ne .Params.DisableShare true) (ne .Params.disable_share true)) -}} + {{ partial "share.html" . }} + {{- end }} + + {{ if (and .Site.Config.Services.Disqus.Shortname (ne .Params.DisableComments true) (ne .Params.disable_comments true)) -}} + <div class="comments"> + <h2>Comments</h2> + {{ template "_internal/disqus.html" . }} + </div> + {{- end }} +</div> +{{- end }}