From ec4fe2eb299aa37cb6ed2d2f37554101528cc48d Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 29 Oct 2017 21:23:47 +0000 Subject: [PATCH] about widget: Add support for linking to forum/chat/mailing-list * Example: `discussion = { name = "Discuss", url = "https://discourse.gohugo.io" }` can be added to `[params]` section of `config.toml` * Add noopener to links that open in new tab See #351 --- exampleSite/config.toml | 4 ++++ layouts/partials/widgets/contact.html | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index bfc554dd..cc2164ca 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -58,6 +58,10 @@ defaultContentLanguageInSubdir = false # Enable Keybase in Contact section by entering your keybase.io username. keybase = "" + # Discussion link (e.g. link to a forum, mailing list, or chat). + # Uncomment line below to use. + # discussion = { name = "Discuss", url = "https://discourse.gohugo.io" } + # Diplay a logo in navigation bar rather than title (optional). # To enable, place an image in `static/img/` and reference its filename below. To disable, set the value to "". logo = "" diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index 87241514..17339818 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -22,11 +22,20 @@ {{ end }} + {{ with $.Site.Params.discussion }} +
  • + + + {{ .name }} + +
  • + {{ end }} + {{ with $.Site.Params.keybase }}
  • - @{{ . }} on Keybase. + @{{ . }} on Keybase.
  • {{ end }} @@ -53,7 +62,7 @@
  • - {{- if $autolink }}@{{ . }}{{ else }}@{{ . }}{{ end -}} + {{- if $autolink }}@{{ . }}{{ else }}@{{ . }}{{ end -}}
  • {{ end }}