From 19b9131073d1da80cc0193af397d5a1ab267f45d Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Fri, 20 Oct 2023 16:06:53 +0200 Subject: Project single page --- layouts/partials/leading_image.html | 30 ++++++++++++++++++++++++++++++ layouts/partials/meta_links.html | 10 ++++++++++ layouts/partials/metadata.html | 13 ------------- layouts/partials/post.html | 1 + 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 layouts/partials/leading_image.html create mode 100644 layouts/partials/meta_links.html (limited to 'layouts/partials') diff --git a/layouts/partials/leading_image.html b/layouts/partials/leading_image.html new file mode 100644 index 0000000..ac528d3 --- /dev/null +++ b/layouts/partials/leading_image.html @@ -0,0 +1,30 @@ +{{ $image := "" }} +{{ if (.Resources.ByType "image").GetMatch "*featured*" }} + {{ $image = (.Resources.ByType "image").GetMatch "*featured*" }} +{{ else if resources.Get (index .Params.images 0) }} + {{ $image = resources.Get (index .Params.images 0) }} +{{ end }} +{{ with $image }} +
+
+ {{ .Title }} + {{ with $.Params.caption }} + + {{ .text }} + + {{ end }} +
+
+{{ end }} diff --git a/layouts/partials/meta_links.html b/layouts/partials/meta_links.html new file mode 100644 index 0000000..00afc71 --- /dev/null +++ b/layouts/partials/meta_links.html @@ -0,0 +1,10 @@ +{{ range $key, $val := .Params.meta_links }} + + {{ $key }} + +{{ end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html index d34c3a8..fdbb504 100644 --- a/layouts/partials/metadata.html +++ b/layouts/partials/metadata.html @@ -1,18 +1,5 @@ {{ $dateTime := .PublishDate.Format "2006-01-02" }} {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} - -{{ range $key, $val := .Params.meta_links }} - - {{ $key }} - -{{ end }} - -

By {{ with .Params.author }} diff --git a/layouts/partials/post.html b/layouts/partials/post.html index b84ba92..768755d 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -1,4 +1,5 @@

+ {{ partial "meta_links.html" . }}

{{ .Title }}

-- cgit v1.2.3