From 6fc462136f6b913014faae04820081f724bd0e98 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Sat, 25 Jun 2022 14:17:44 +1000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Improve=20layout=20of=20comments=20?= =?UTF-8?q?and=20add=20params=20to=20toggle=20display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref #207 --- CHANGELOG.md | 2 ++ assets/css/compiled/main.css | 18 +++++++++--------- config/_default/params.toml | 1 + exampleSite/config/_default/params.toml | 1 + exampleSite/content/docs/configuration.md | 1 + exampleSite/content/docs/front-matter.md | 1 + layouts/_default/single.html | 15 ++++++++++++--- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b2615a..ee5c2468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added +- Front matter support for showing or hiding comments on a per article basis - `showCopyright` and `showThemeAttribution` parameters that allow more control over how the site footer is displayed ### Changed - Search will now return results for all page types, including lists and taxonomies +- Comments partials are now better considered within the page layout - Upgrade to Tailwind v3.1.4 ([#225](https://github.com/jpanther/congo/pull/225)) ### Fixed diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 8c516596..f03f869a 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -2059,16 +2059,16 @@ body button { border-color: rgba(var(--color-neutral-400), var(--tw-border-opacity)); } -.border-neutral-200 { - --tw-border-opacity: 1; - border-color: rgba(var(--color-neutral-200), var(--tw-border-opacity)); -} - .border-neutral-300 { --tw-border-opacity: 1; border-color: rgba(var(--color-neutral-300), var(--tw-border-opacity)); } +.border-neutral-200 { + --tw-border-opacity: 1; + border-color: rgba(var(--color-neutral-200), var(--tw-border-opacity)); +} + .border-primary-400 { --tw-border-opacity: 1; border-color: rgba(var(--color-primary-400), var(--tw-border-opacity)); @@ -2203,14 +2203,14 @@ body button { padding-top: 2rem; } -.pl-2 { - padding-left: 0.5rem; -} - .pt-3 { padding-top: 0.75rem; } +.pl-2 { + padding-left: 0.5rem; +} + .pb-4 { padding-bottom: 1rem; } diff --git a/config/_default/params.toml b/config/_default/params.toml index 67ba5962..fea478ea 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -39,6 +39,7 @@ enableCodeCopy = false showTableOfContents = false showTaxonomies = false showWordCount = false + showComments = false # sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"] [list] diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 642ec644..f19be023 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -39,6 +39,7 @@ mainSections = ["samples"] showTableOfContents = true showTaxonomies = false showWordCount = false + showComments = false # sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"] [list] diff --git a/exampleSite/content/docs/configuration.md b/exampleSite/content/docs/configuration.md index fdc36fd3..183b8721 100644 --- a/exampleSite/content/docs/configuration.md +++ b/exampleSite/content/docs/configuration.md @@ -142,6 +142,7 @@ Many of the article defaults here can be overridden on a per article basis by sp |`article.showTableOfContents`|`false`|Whether or not the table of contents is displayed on articles.| |`article.showTaxonomies`|`false`|Whether or not the taxonomies related to this article are displayed.| |`article.showWordCount`|`false`|Whether or not article word counts are displayed.| +|`article.showComments`|`false`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.| |`article.sharingLinks`|_Not set_|Which sharing links to display at the end of each article. When not provided, or set to `false` no links will be displayed.| |`list.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the header on list pages.| |`list.showTableOfContents`|`false`|Whether or not the table of contents is displayed on list pages.| diff --git a/exampleSite/content/docs/front-matter.md b/exampleSite/content/docs/front-matter.md index 170f49f3..d50bc7d1 100644 --- a/exampleSite/content/docs/front-matter.md +++ b/exampleSite/content/docs/front-matter.md @@ -35,6 +35,7 @@ Front matter parameter default values are inherited from the theme's [base confi |`showTaxonomies`|`article.showTaxonomies`|Whether or not the taxonomies that relate to this article are displayed.| |`showTableOfContents`|`article.showTableOfContents`|Whether or not the table of contents is displayed on this article.| |`showWordCount`|`article.showWordCount`|Whether or not the article word count is displayed.| +|`showComments`|`article.showComments`|Whether or not the [comments partial]({{< ref "partials#comments" >}}) is included after the article footer.| |`showSummary`|`list.showSummary`|Whether or not the article summary should be displayed on list pages.| |`summary`|Auto generated using `summaryLength` (see [site configuration]({{< ref "configuration#site-configuration" >}}))|When `showSummary` is enabled, this is the Markdown string to be used as the summary for this article.| |`xml`|`true` unless excluded by `sitemap.excludedKinds`|Whether or not this article is included in the generated `/sitemap.xml` file.| diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b78d7ac4..49deed79 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -27,9 +27,18 @@ {{ partial "author.html" . }} {{ partial "sharing-links.html" . }} {{ partial "article-pagination.html" . }} + {{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }} + {{ if templates.Exists "partials/comments.html" }} +