From b8a8f96010a5ceb3382340a527d551b9d12dfdf6 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:35:24 +1000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20`profile`=20shortcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + assets/css/compiled/main.css | 4 +++ exampleSite/content/docs/shortcodes/index.md | 20 +++++++++++++ layouts/partials/author-links.html | 2 +- layouts/partials/home/profile.html | 23 +-------------- layouts/partials/profile.html | 31 ++++++++++++++++++++ layouts/shortcodes/profile.html | 2 ++ 7 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 layouts/partials/profile.html create mode 100644 layouts/shortcodes/profile.html diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e737d..414b7b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added +- New `profile` shortcode - Umami Analytics support ([#832](https://github.com/jpanther/congo/pull/832)) - Theme parameter to set a default HTML theme colour ([#849](https://github.com/jpanther/congo/pull/849)) - New icon for `bluesky` ([#851](https://github.com/jpanther/congo/pull/851)) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 5d18fa1..9a8d2af 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -2162,6 +2162,10 @@ code { align-items: flex-start; } +.items-end { + align-items: flex-end; +} + .items-center { align-items: center; } diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index f3c43fe..bd58e56 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -234,3 +234,23 @@ B-->C[Profit] {{< /mermaid >}} You can see some additional Mermaid examples on the [diagrams and flowcharts samples]({{< ref "diagrams-flowcharts" >}}) page. + +## Profile + +The `profile` shortcode inserts a block displaying the site author's details. The same template is used on Congo's homepage layouts, but can also be inserted in any article content. It has one optional parameter: + + +|Parameter|Description| +|---|---| +|`align`|The alignment of the profile elements - valid options include `start`, `center` and `end`. If no value is provided, the `center` alignment will be used.| + + +The template is populated using the author parameters set in the [Language Configuration]({{< ref "configuration#configuration" >}}). + +**Example:** + +```md +{{* profile align="center" */>}} +``` + +{{< profile align="center" >}} diff --git a/layouts/partials/author-links.html b/layouts/partials/author-links.html index d193fd8..cbcd33a 100644 --- a/layouts/partials/author-links.html +++ b/layouts/partials/author-links.html @@ -1,4 +1,4 @@ -{{ with .Site.Language.Params.Author.links }} +{{ with site.Language.Params.Author.links }}