diff options
author | jesselau76 <jesselau76@gmail.com> | 2018-11-16 11:21:36 +0300 |
---|---|---|
committer | jesselau76 <jesselau76@gmail.com> | 2018-11-16 11:21:36 +0300 |
commit | 8f99af3f89eb45da2936c3c30f6f62d3a8956499 (patch) | |
tree | 5d0d87761a21c0e2d7772a0291fd816bbee71421 | |
parent | 09f61d809ba5a6e61817bc26d5fa5e011b621aee (diff) |
author and license
-rw-r--r-- | exampleSite/config.toml | 5 | ||||
-rw-r--r-- | i18n/en.yaml | 3 | ||||
-rw-r--r-- | i18n/zh-cn.yaml | 3 | ||||
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/post/single.html | 24 | ||||
-rw-r--r-- | layouts/section/allposts.html | 2 |
6 files changed, 37 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index acca39b..6074b97 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -28,6 +28,11 @@ hasCJKLanguage = true # has chinese/japanese/korean ? [params] + authorandlicense = true + authorimgurl = "https://jesselau.com/wp-content/uploads/2018/08/jeselau.jpg" #if authorandlicense set true, this one must be set too + authorinfo = "<h4>Authored By John Doe</h4>" + licenseinfo = "<p class=\"w3-small\">John Doe, a good man living in the earth, loving build website with Hugo.<br>This article is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\" class=\"w3-text-white\">Creative Commons Attribution 4.0 International License</a>.</p>" + relatedPosts = true backtotop = true gridstyle = true # list post with grid style. If false then simple list diff --git a/i18n/en.yaml b/i18n/en.yaml index 238ef29..9a85a63 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -59,3 +59,6 @@ postsdate: postsword: other: "Word Count" + +postssearch: + other: "Search Posts..." diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index a79ba9a..55dc148 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -61,3 +61,6 @@ postsdate: postsword: other: "帖子字数" +postssearch: + other: "搜索帖子..." + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bafb397..93a292f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -46,7 +46,7 @@ </div> <footer > - <a href="{{ .URL }}"><button class="w3-button w3-blue w3-block w3-hover-green">Read More</button></a> + <a href="{{ .URL }}"><button class="w3-button w3-blue w3-block w3-hover-green">{{ T "readMore" }}</button></a> </footer> </div> </div> diff --git a/layouts/post/single.html b/layouts/post/single.html index 80e1278..e6ae596 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -112,6 +112,11 @@ function scrollFunction() { </div> + + + + + {{ if .Site.Params.relatedPosts }} {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }} @@ -130,6 +135,25 @@ function scrollFunction() { {{ end }} <br> </div> + +<!-- Author and License --> +{{ if .Site.Params.authorandlicense }} +<div class="w3-container w3-card-2 w3-black"> +<div class="w3-row"> + <div class="w3-col l2 m2 s12 w3-center"> + + <img src="{{ .Site.Params.authorimgurl }}" width ="100px" class="w3-circle w3-center w3-margin-top" alt="Norway" > + + </div> + <div class="w3-col l10 m10 s12 "> + <div class = "w3-container w3-margin-top"> + {{ .Site.Params.authorinfo | safeHTML }} + {{ .Site.Params.licenseinfo | safeHTML }} + </div> + </div> + </div> +</div> +{{ end }} <!-- Post Pagination --> <div class="w3-content" > <div class="w3-bar w3-section"> diff --git a/layouts/section/allposts.html b/layouts/section/allposts.html index 00a4537..9c7804e 100644 --- a/layouts/section/allposts.html +++ b/layouts/section/allposts.html @@ -9,7 +9,7 @@ <p>
-<input oninput="w3.filterHTML('#id01', '.item', this.value)" class="w3-input" placeholder="Search for posts..">
+<input oninput="w3.filterHTML('#id01', '.item', this.value)" class="w3-input" placeholder="{{ T "postssearch"}}">
</p>
<div style="overflow-x:auto;">
<table id="id01" class="w3-table-all w3-hoverable">
|