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

github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvvveiii <cntrump@gmail.com>2020-05-03 14:33:59 +0300
committervvveiii <cntrump@gmail.com>2020-05-03 14:33:59 +0300
commitaf0dfbb8b0bd03aaedcef993fb75f5a773f46677 (patch)
treed2d1b4c394feb52e45a2c311f5e5c812e1e97b63
parent73bd436516854ff944a5955b8bf27bac48d642df (diff)
Update author profile format
-rw-r--r--README.md32
-rw-r--r--exampleSite/config.toml8
-rw-r--r--layouts/partials/article-author.html8
3 files changed, 17 insertions, 31 deletions
diff --git a/README.md b/README.md
index 9928fda..f0d2358 100644
--- a/README.md
+++ b/README.md
@@ -376,18 +376,10 @@ Global settings, Edit `config.toml`
avatar = "/img/avatar.jpg"
name = "XXX"
bio = "XXX" # support markdown syntax
-
-[params.author.twitter]
- name = "XXX" # https://twitter.com/XXX
-
-[params.author.github]
- name = "XXX" # https://github.com/XXX
-
-[params.author.docker]
- name = "XXX" # https://hub.docker.com/u/XXX
-
-[params.author.email]
- name = "XXX@mail.com" # mailto:XXX@mail.com
+ twitter = "XXX" # https://twitter.com/XXX
+ github = "XXX" # https://github.com/XXX
+ docker = "XXX" # https://hub.docker.com/u/XXX
+ email = "XXX@mail.com" # mailto:XXX@mail.com
```
Or page-by-page, on front matter:
@@ -399,15 +391,13 @@ date = 2020-05-01T22:20:36+08:00
[author]
enable = true
- avatar = "https://d33wubrfki0l68.cloudfront.net/ddf49425628d8aec7523db143916b34ae1641e11/b97e8/images/gopher-side_color.svg"
- name = "gohugo"
- bio = "Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again." # support markdown syntax
-
-[author.twitter]
- name = "GoHugoIO" # https://twitter.com/XXX
-
-[author.github]
- name = "gohugoio" # https://github.com/XXX
+ avatar = "/img/avatar.jpg"
+ name = "XXX"
+ bio = "XXX" # support markdown syntax
+ twitter = "XXX" # https://twitter.com/XXX
+ github = "XXX" # https://github.com/XXX
+ docker = "XXX" # https://hub.docker.com/u/XXX
+ email = "XXX@mail.com" # mailto:XXX@mail.com
+++
```
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 69b31fe..abeb0dc 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -56,12 +56,8 @@ darkTheme = "xcode-dark"
avatar = "https://d33wubrfki0l68.cloudfront.net/ddf49425628d8aec7523db143916b34ae1641e11/b97e8/images/gopher-side_color.svg"
name = "gohugo"
bio = "Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again." # support markdown syntax
-
-[params.author.twitter]
- name = "GoHugoIO" # https://twitter.com/XXX
-
-[params.author.github]
- name = "gohugoio" # https://github.com/XXX
+ twitter = "GoHugoIO" # https://twitter.com/XXX
+ github = "gohugoio" # https://github.com/XXX
[params.nav]
showCategories = true # /categories/
diff --git a/layouts/partials/article-author.html b/layouts/partials/article-author.html
index 8564819..e2adaca 100644
--- a/layouts/partials/article-author.html
+++ b/layouts/partials/article-author.html
@@ -14,19 +14,19 @@
<div class="details">
{{- with .github -}}
- <a class="item" href="https://github.com/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-github"></span>&nbsp;{{- .name -}}</a>
+ <a class="item" href="https://github.com/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-github"></span>&nbsp;{{- . -}}</a>
{{- end -}}
{{- with .docker -}}
- <a class="item" href="https://hub.docker.com/u/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-docker"></span>&nbsp;{{- .name -}}</a>
+ <a class="item" href="https://hub.docker.com/u/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-docker"></span>&nbsp;{{- . -}}</a>
{{- end -}}
{{- with .twitter -}}
- <a class="item" href="https://twitter.com/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-twitter"></span>&nbsp;@{{- .name -}}</a>
+ <a class="item" href="https://twitter.com/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-twitter"></span>&nbsp;@{{- . -}}</a>
{{- end -}}
{{- with .email -}}
- <a class="item" href="mailto:{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-email"></span>&nbsp;{{- .name -}}</a>
+ <a class="item" href="mailto:{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-email"></span>&nbsp;{{- . -}}</a>
{{- end -}}
</div>
</section>