From f7fbd1e7f2f9be08ecca064d247a8cb74db41c7a Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Mon, 28 Dec 2020 11:14:39 +0100 Subject: [PATCH] Move author and date information for post to common partials To remove code duplication, let's move this to a partial and reuse it. --- layouts/micro/single.html | 3 +-- layouts/micro/summary.html | 3 +-- layouts/partials/author-date.html | 2 ++ layouts/partials/submitted.html | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/author-date.html diff --git a/layouts/micro/single.html b/layouts/micro/single.html index 20f180c..c8731e0 100644 --- a/layouts/micro/single.html +++ b/layouts/micro/single.html @@ -4,8 +4,7 @@

{{ .Title }}

-{{ with $.Param "author" }}{{ . }} – {{ end -}} - +{{ partial "author-date" . }}

diff --git a/layouts/micro/summary.html b/layouts/micro/summary.html index 6acdab4..28aa9d5 100644 --- a/layouts/micro/summary.html +++ b/layouts/micro/summary.html @@ -2,8 +2,7 @@

-{{ with $.Param "author" }}{{ . }} – {{ end -}} - +{{ partial "author-date" . }}

diff --git a/layouts/partials/author-date.html b/layouts/partials/author-date.html new file mode 100644 index 0000000..10fa659 --- /dev/null +++ b/layouts/partials/author-date.html @@ -0,0 +1,2 @@ +{{ with $.Param "author" }} – {{ end -}} + \ No newline at end of file diff --git a/layouts/partials/submitted.html b/layouts/partials/submitted.html index 55ff27c..b41bf73 100644 --- a/layouts/partials/submitted.html +++ b/layouts/partials/submitted.html @@ -1,4 +1,3 @@