From b267de84f8e780c6e8b323ede25af987447c88fb Mon Sep 17 00:00:00 2001 From: vimux Date: Mon, 21 May 2018 23:08:56 +0300 Subject: [PATCH] Add initial thumbnail support --- layouts/_default/single.html | 1 + layouts/_default/summary.html | 1 + layouts/partials/post_thumbnail.html | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 layouts/partials/post_thumbnail.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 42d919c..4830b53 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,6 +2,7 @@
+ {{- partial "post_thumbnail.html" (dict "page" . ) }}

{{ .Title }}

{{ .Content }}
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 48c6f7b..6381dd3 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,4 +1,5 @@
+ {{- partial "post_thumbnail.html" (dict "page" . ) }}

{{ .Title }}

{{- .Summary }}
diff --git a/layouts/partials/post_thumbnail.html b/layouts/partials/post_thumbnail.html new file mode 100644 index 0000000..d2528bd --- /dev/null +++ b/layouts/partials/post_thumbnail.html @@ -0,0 +1,6 @@ +{{- $img := ( .page.Resources.ByType "image").GetMatch "thumbnail.*" }} +{{- with $img }} +
+ {{ $img.Title }} +
+{{- end }} \ No newline at end of file