From 0f9ba2e69d6891d3beb8b2a57de356e432f8d419 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Fri, 14 Jul 2017 02:35:36 -0500 Subject: factor out the author info template --- layouts/_default/single.html | 12 +----------- layouts/partials/author.html | 10 ++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 layouts/partials/author.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7d79266..fa27748 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -30,17 +30,7 @@ {{ .Content }} -{{ with .Params.author }} -{{ if $.Site.Data.authors }} -{{ with (index $.Site.Data.authors .) }} -
-

{{ default "About the Author" $.Site.Params.text.about_author }}

-

{{ . | markdownify }}

-
-{{ end }} -{{ end }} -{{ end }} - +{{ partial "author.html" . }} {{ partial "info.html" . }} {{ if .Section }} diff --git a/layouts/partials/author.html b/layouts/partials/author.html new file mode 100644 index 0000000..c5ed53d --- /dev/null +++ b/layouts/partials/author.html @@ -0,0 +1,10 @@ +{{ with .Params.author }} +{{ if $.Site.Data.authors }} +{{ with (index $.Site.Data.authors .) }} +
+

{{ default "About the Author" $.Site.Params.text.about_author }}

+

{{ . | markdownify }}

+
+{{ end }} +{{ end }} +{{ end }} -- cgit v1.2.3