From f49d28caa3005c608eec9f8f82b1d9625ae37c01 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 10 Aug 2024 21:03:16 -0500 Subject: initial commit --- layouts/_default/_markup/render-link.html | 1 + layouts/_default/baseof.html | 32 +++++++++++++++++++++++++++++ layouts/_default/list.html | 11 ++++++++++ layouts/_default/single.html | 20 ++++++++++++++++++ layouts/shortcodes/img.html | 34 +++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 layouts/_default/_markup/render-link.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/shortcodes/img.html (limited to 'layouts') diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000..f04b2e3 --- /dev/null +++ b/layouts/_default/_markup/render-link.html @@ -0,0 +1 @@ +{{ .Text | safeHTML }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..e5b0ed0 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,32 @@ + + + + {{ $title := print .Title " - " .Site.Title }} + {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} + {{ $title | title }} + + + {{- block "head" . }}{{- end }} + + +
+ {{ .Site.Title }} + {{ .Title }} + +
+
+ {{- block "main" . }}{{- end }} +
+ + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..06b99a2 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,11 @@ +{{ define "main" }} + +{{ .Content }} + + + +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..099d3fc --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,20 @@ +{{ define "main" }} + +
+ {{ .PublishDate | time.Format ":date_long" }} + {{ if and (isset .Params "lastmod") (ne .Lastmod .PublishDate) }} +
+ Revised: {{ .Lastmod | time.Format ":date_long" }} + {{ end }} + {{ if isset .Params "tags" }} +
+ Tags: + {{- range sort .Params.tags }} + {{ . | humanize | title }} + {{- end }} + {{ end }} +
+ +{{ .Content }} + +{{ end }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..65ca44f --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,34 @@ + + + +{{ $image := resources.GetMatch (.Get "src") }} + + +{{ $alt := .Get "alt" | default "" }} +{{ $rotation := .Get "rotation" | default 0 }} + + +{{ $quality := .Get "quality" | default "original" }} + +{{ $q := 0 }} +{{ $size := 0 }} +{{ if eq $quality "low" }} + {{ $q = 60 }} + {{ $size = 600 }} +{{ else if eq $quality "medium" }} + {{ $q = 75 }} + {{ $size = 1000 }} +{{ else if eq $quality "high" }} + {{ $q = 90 }} + {{ $size = 1200 }} +{{ end }} + + + +{{ if ne $quality "original" }} + {{ $image = $image.Resize (printf "%dx q%d r%d" $size $q $rotation) }} +{{ end }} +
+ {{ $alt }} +
{{ $alt }}
+
-- cgit v1.2.3