From 392e89722d35e9be7443d684aa67f49737e26df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 28 Jan 2024 17:06:04 +0000 Subject: [PATCH] fix gallery js code --- config/_default/params.toml | 1 + exampleSite/config/_default/params.toml | 1 + exampleSite/content/docs/configuration/index.md | 5 +++-- layouts/partials/article-meta/basic.html | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index 4ec4494b..5bd80fd6 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -50,6 +50,7 @@ disableTextInHeader = false showDate = true showViews = false showLikes = false + showDateOnlyInArticle = false showDateUpdated = false showAuthor = true showHero = false diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 11319d68..ed3328af 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -50,6 +50,7 @@ smartTOCHideUnfocusedChildren = false showDate = false showViews = true showLikes = true + showDateOnlyInArticle = false showDateUpdated = false showAuthor = true showHero = true diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 4f2b7fe0..1594ef56 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -203,7 +203,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `homepage.homepageImage` | _Not set_ | Image to be used in `hero` and `card` layouts. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details. | | `homepage.showRecent` | `false` | Whether or not to display the recent articles list on the homepage. | | `homepage.showRecentItems` | 5 | How many articles to display if showRecent is true. If variable is set to 0 or if it isn't defined the system will default to 5 articles. | -| `homepage.showMoreLink` | `false` | Whether or not to display a show more link at the end of your posts that takes the user to a predefined place. | +| `homepage.showMoreLink` | `false` | Whether or not to display a show more link at the end of your posts that takes the user to a predefined place. | | `homepage.showMoreLinkDest` | `/posts` | The destination of the show more button. | | `homepage.cardView` | `false` | Display recent articles as a gallery of cards. | | `homepage.cardViewScreenWidth` | `false` | Enhance the width of the recent articles card gallery to take the full width available. | @@ -215,6 +215,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `article.showDate` | `true` | Whether or not article dates are displayed. | | `article.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. | | `article.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. | +| `article.showDateOnlyInArticle` | `false` | Show date within article even if not displayed in article listings/cards. | | `article.showDateUpdated` | `false` | Whether or not the dates articles were updated are displayed. | | `article.showAuthor` | `true` | Whether or not the author box is displayed in the article footer. | | `article.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each article page. | @@ -239,7 +240,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `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. Available values are: "linkedin", "twitter", "reddit", "pinterest", "facebook", "email", "whatsapp", and "telegram" | -| `article.showZenMode` | `false` | Flag to activate Zen Mode reading feature for articles. | +| `article.showZenMode` | `false` | Flag to activate Zen Mode reading feature for articles. | ### List diff --git a/layouts/partials/article-meta/basic.html b/layouts/partials/article-meta/basic.html index 5b158130..1fd4d72e 100644 --- a/layouts/partials/article-meta/basic.html +++ b/layouts/partials/article-meta/basic.html @@ -12,7 +12,9 @@ {{ $meta := newScratch }} {{/* Gather partials for this context */}} -{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} +{{ if .Params.showDate | default (.Site.Params.article.showDate | default false) }} + {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }} +{{else if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }} {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }} {{ end }}