Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2017-07-14 10:35:36 +0300
committerYihui Xie <xie@yihui.name>2017-07-14 10:35:36 +0300
commit0f9ba2e69d6891d3beb8b2a57de356e432f8d419 (patch)
tree55a08230fd9e50fd171e884f5a0c735a13a78b88
parent15aec575271a335bbdef4efe1260744aad94323d (diff)
factor out the author info template
-rw-r--r--layouts/_default/single.html12
-rw-r--r--layouts/partials/author.html10
2 files changed, 11 insertions, 11 deletions
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 }}
</main>
-{{ with .Params.author }}
-{{ if $.Site.Data.authors }}
-{{ with (index $.Site.Data.authors .) }}
-<section class="article-meta article-footer">
- <h3>{{ default "About the Author" $.Site.Params.text.about_author }}</h3>
- <p>{{ . | markdownify }}</p>
-</section>
-{{ 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 .) }}
+<section class="article-meta article-footer">
+ <h3>{{ default "About the Author" $.Site.Params.text.about_author }}</h3>
+ <p>{{ . | markdownify }}</p>
+</section>
+{{ end }}
+{{ end }}
+{{ end }}