diff options
author | vvveiii <cntrump@gmail.com> | 2020-05-03 14:33:59 +0300 |
---|---|---|
committer | vvveiii <cntrump@gmail.com> | 2020-05-03 14:33:59 +0300 |
commit | af0dfbb8b0bd03aaedcef993fb75f5a773f46677 (patch) | |
tree | d2d1b4c394feb52e45a2c311f5e5c812e1e97b63 | |
parent | 73bd436516854ff944a5955b8bf27bac48d642df (diff) |
Update author profile format
-rw-r--r-- | README.md | 32 | ||||
-rw-r--r-- | exampleSite/config.toml | 8 | ||||
-rw-r--r-- | layouts/partials/article-author.html | 8 |
3 files changed, 17 insertions, 31 deletions
@@ -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> {{- .name -}}</a> + <a class="item" href="https://github.com/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-github"></span> {{- . -}}</a> {{- end -}} {{- with .docker -}} - <a class="item" href="https://hub.docker.com/u/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-docker"></span> {{- .name -}}</a> + <a class="item" href="https://hub.docker.com/u/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-docker"></span> {{- . -}}</a> {{- end -}} {{- with .twitter -}} - <a class="item" href="https://twitter.com/{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-twitter"></span> @{{- .name -}}</a> + <a class="item" href="https://twitter.com/{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-twitter"></span> @{{- . -}}</a> {{- end -}} {{- with .email -}} - <a class="item" href="mailto:{{- .name | safeURL -}}" target="_blank"><span class="iconfont icon-email"></span> {{- .name -}}</a> + <a class="item" href="mailto:{{- . | safeHTML -}}" target="_blank"><span class="iconfont icon-email"></span> {{- . -}}</a> {{- end -}} </div> </section> |