From db134785e4d2086a03cc24670ffb23167dfc0b41 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 20 Oct 2021 10:44:57 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20sharing=20links=20to=20fro?= =?UTF-8?q?nt=20matter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + exampleSite/content/docs/front-matter.md | 1 + layouts/partials/sharing-links.html | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cada51f..96c6357b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Article summary support - Slate colour scheme ([#9](https://github.com/jpanther/congo/pull/9)) - Icons for ORCID and ResearchGate ([#9](https://github.com/jpanther/congo/pull/9)) +- Sharing links can now be specified in front matter ### Changed diff --git a/exampleSite/content/docs/front-matter.md b/exampleSite/content/docs/front-matter.md index bd67d2a2..b8913d2d 100644 --- a/exampleSite/content/docs/front-matter.md +++ b/exampleSite/content/docs/front-matter.md @@ -20,6 +20,7 @@ Front matter parameter default values are inherited from the theme's [base confi |`editAppendPath`|boolean|`article.editAppendPath`|When `showEdit` is active, whether or not the path to the current article should be appended to the URL set at `editURL`.| |`menu`|string or array|_Not set_|When a value is provided, a link to this article will appear in the named menus. Valid values are `main` or `footer`.| |`robots`|string|_Not set_|String that indicates how robots should handle this article. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.| +|`sharingLinks`|array of strings|`article.sharingLinks`|Which sharing links to display at the end of this article. When not provided, or set to `false` no links will be displayed.| |`showAuthor`|boolean|`article.showAuthor`|Whether or not the author box is displayed in the article footer.| |`showDate`|boolean|`article.showDate`|Whether or not article dates are displayed.| |`showEdit`|boolean|`article.showEdit`|Whether or not the link to edit the article content should be displayed.| diff --git a/layouts/partials/sharing-links.html b/layouts/partials/sharing-links.html index 4dbdfc80..a3d9a5ae 100644 --- a/layouts/partials/sharing-links.html +++ b/layouts/partials/sharing-links.html @@ -1,4 +1,4 @@ -{{ with .Site.Params.article.sharingLinks }} +{{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }} {{ $links := site.Data.sharing }}
{{ range . }}