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

github.com/joway/hugo-theme-yinyang.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoway.CI <joway.w@gmail.com>2020-03-03 08:05:27 +0300
committerJoway.CI <joway.w@gmail.com>2020-03-03 08:05:27 +0300
commit4c69ebd35eb6205ad77f43eb73d4ce2ab794e73d (patch)
treefb364217de3d63037363209790912fea4cc9aaa1
parente78d1ebf7f06d58a4717b6dcc46558cb4c0d5d8c (diff)
feat: postFooterContent and postHeaderContent
-rw-r--r--README.md10
-rw-r--r--layouts/_default/single.html6
2 files changed, 14 insertions, 2 deletions
diff --git a/README.md b/README.md
index 355ddf1..6b06ce0 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,14 @@ link = "https://github.com/joway"
extraHead = '<script src="xxxx.js"></script>'
```
+### Insert content on every post
+
+```
+[params]
+postHeaderContent = ""
+postFooterContent = "<br/><br/><p>Subscribe:<a target='_blank' href='https://mailchi.mp/a1a0d59e7a19/joway'>Joway's Blog</a></p>"
+```
+
### Example
```
@@ -117,4 +125,6 @@ link = "https://joway.io"
[[params.socials]]
name = "Github"
link = "https://github.com/joway"
+postHeaderContent = ""
+postFooterContent = "<br/><br/><p>Subscribe to:<a target='_blank' href='https://mailchi.mp/a1a0d59e7a19/joway'>Joway's Blog</a></p>"
```
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 80bd854..1e8a070 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -11,7 +11,7 @@
</div>
<header class="post-header">
<h1 class="post-title">{{ .Title }}</h1>
- {{ if in site.Params.mainSections .Type }}
+ {{ if in .Site.Params.mainSections .Type }}
<div class="row post-desc">
<div class="col-xs-6">
{{ if .Date }}
@@ -32,7 +32,9 @@
</header>
<div class="post-content markdown-body">
+ {{ .Site.Params.postHeaderContent | safeHTML }}
{{ .Content }}
+ {{ .Site.Params.postFooterContent | safeHTML }}
</div>
<div class="row middle-xs">
@@ -47,7 +49,7 @@
</div>
</div>
- {{ if in site.Params.mainSections .Type }}
+ {{ if in .Site.Params.mainSections .Type }}
{{ partial "related.html" . }}
{{ if .Site.Params.postAds }}
<div class="post-ads">{{ .Site.Params.postAds | safeHTML }}</div>