From dc0407a0e2fad29e624479bd17f7c89a4aa28582 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 24 Sep 2019 22:25:16 +0100 Subject: [PATCH] feat: add option to disable linking authors to their profile page `link_authors` option added to `params.toml`. Close #982 --- exampleSite/config/_default/params.toml | 3 +++ layouts/partials/page_metadata_authors.html | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 905a19b4..ba0d97e0 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -160,6 +160,9 @@ docs_section_pager = true # Display pager in Docs layout (e.g. tutorials)? # Enable in-built social sharing buttons? (true/false) sharing = true +# Link authors to their profile page? (true/false) +link_authors = true + # Load CSS and JS plugins # E.g. To load `/assets/css/custom.css`, set `plugins_css = ["custom"]`. # E.g. To load `/assets/js/custom.js`, set `plugins_js = ["custom"]`. diff --git a/layouts/partials/page_metadata_authors.html b/layouts/partials/page_metadata_authors.html index ce802f6f..b80fddeb 100644 --- a/layouts/partials/page_metadata_authors.html +++ b/layouts/partials/page_metadata_authors.html @@ -2,13 +2,14 @@ {{ $taxonomy := "authors" }} {{ with .Param $taxonomy }} + {{ $link_authors := site.Params.link_authors | default true }} {{ range $index, $value := . }} {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy (. | urlize)) -}} {{- $name := $profile_page.Params.name | default ($value|markdownify) -}} {{- if gt $index 0 }}, {{ end -}} {{- with $profile_page -}} - {{$name}} + {{ if $link_authors }}{{$name}}{{else}}{{$name}}{{end}} {{- else -}} {{$name}} {{- end -}}