Related articles feature added

This commit is contained in:
Nuno Coração
2023-04-29 15:56:55 +01:00
parent 974fbf2687
commit 66198da716
40 changed files with 274 additions and 81 deletions
+1 -1
View File
@@ -35,8 +35,8 @@ window.addEventListener("DOMContentLoaded", (event) => {
});
var list_config = [
"CardViewScreenWidth",
"CardViewProse",
"CardViewScreenWidth",
"NormalView"
]
+30
View File
@@ -33,3 +33,33 @@ googleAnalytics = "G-PEDMYR1V0K"
[outputs]
home = ["HTML", "RSS", "JSON"]
[related]
threshold = 0
toLower = false
[[related.indices]]
name = "tags"
weight = 100
[[related.indices]]
name = "categories"
weight = 100
[[related.indices]]
name = "series"
weight = 50
[[related.indices]]
name = "authors"
weight = 20
[[related.indices]]
name = "date"
weight = 10
[[related.indices]]
applyFilter = false
name = 'fragmentrefs'
type = 'fragments'
weight = 10
+17 -18
View File
@@ -15,37 +15,36 @@
pageRef = "docs"
weight = 10
[[main]]
name = "Examples"
weight = 20
#[[main]]
# name = "Examples"
# weight = 20
[[main]]
name = "Recipes"
parent = "Examples"
pageRef = "guides"
weight = 10
[[main]]
name = "Samples"
parent = "Examples"
pageRef = "samples"
weight = 20
[[main]]
name = "Showcase"
parent = "Examples"
pageRef = "examples"
weight = 30
[[main]]
name = "Users"
pageRef = "users"
name = "Recipes"
pageRef = "guides"
weight = 40
[[main]]
name = "Merch"
url = "http://tee.pub/lic/qwSlWVBL5zc"
weight = 50
name = "Users"
pageRef = "users"
weight = 90
#[[main]]
# name = "Merch"
# url = "http://tee.pub/lic/qwSlWVBL5zc"
# weight = 100
#[[main]]
# name = "Test"
@@ -56,19 +55,19 @@
identifier = "twitter"
pre = "twitter"
url = "https://twitter.com/burufugu"
weight = 60
weight = 200
[[main]]
identifier = "mastodon"
pre = "mastodon"
url = "https://masto.ai/@blowfish"
weight = 70
weight = 300
[[main]]
identifier = "github"
pre = "github"
url = "https://github.com/nunocoracao/blowfish"
weight = 80
weight = 400
# -- Footer Menu --
+4 -2
View File
@@ -18,7 +18,7 @@ mainSections = ["docs"]
disableImageOptimization = false
defaultBackgroundImage = "/img/bg.jpg"
#defaultFeaturedImage = "/img/blowfish_logo.png"
defaultFeaturedImage = "/img/paint.png"
highlightCurrentMenuArea = true
smartTOC = true
@@ -38,7 +38,7 @@ smartTOCHideUnfocusedChildren = true
layout = "custom" # valid options: page, profile, hero, card, background, custom
# homepageImage = "/img/iceland.jpg" # used in: hero, and card
showRecent = false
showRecentItems = 10
showRecentItems = 6
showMoreLink = true
showMoreLinkDest = "docs"
cardView = false
@@ -65,6 +65,8 @@ smartTOCHideUnfocusedChildren = true
invertPagination = false
showReadingTime = true
showTableOfContents = true
showRelatedContent = true
relatedContentLimit = 6
showTaxonomies = true
showAuthorsBadges = true
showWordCount = false
+30 -28
View File
@@ -181,34 +181,36 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `homepage.layoutBackgroundBlur` | `false` | Makes the background image in the homepage layout blur with the scroll |
### Article
| Name | Default | Description |
| ------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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.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. |
| `article.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. |
| `article.layoutBackgroundBlur` | `true` | Makes the background image in the background article heroStyle blur with the scroll |
| `article.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. |
| `article.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the article header. |
| `article.showDraftLabel` | `true` | Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`. |
| `article.showEdit` | `false` | Whether or not the link to edit the article content should be displayed. |
| `article.editURL` | _Not set_ | When `article.showEdit` is active, the URL for the edit link. |
| `article.editAppendPath` | `true` | When `article.showEdit` is active, whether or not the path to the current article should be appended to the URL set at `article.editURL`. |
| `article.seriesOpened` | `false` | Whether or not the series module will be displayed open by default or not. |
| `article.showHeadingAnchors` | `true` | Whether or not heading anchor links are displayed alongside headings within articles. |
| `article.showPagination` | `true` | Whether or not the next/previous article links are displayed in the article footer. |
| `article.invertPagination` | `false` | Whether or not to flip the direction of the next/previous article links. |
| `article.showReadingTime` | `true` | Whether or not article reading times are displayed. |
| `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.showAuthorsBadges` | `false` | Whether the `authors` taxonomies are are displayed in the article or list header. This requires the setup of `multiple authors` and the `authors` taxonomy. Check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature. |
| `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.showSummary` | `false` | Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration). |
| `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" |
| Name | Default | Description |
| ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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.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. |
| `article.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. |
| `article.layoutBackgroundBlur` | `true` | Makes the background image in the background article heroStyle blur with the scroll |
| `article.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. |
| `article.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the article header. |
| `article.showDraftLabel` | `true` | Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`. |
| `article.showEdit` | `false` | Whether or not the link to edit the article content should be displayed. |
| `article.editURL` | _Not set_ | When `article.showEdit` is active, the URL for the edit link. |
| `article.editAppendPath` | `true` | When `article.showEdit` is active, whether or not the path to the current article should be appended to the URL set at `article.editURL`. |
| `article.seriesOpened` | `false` | Whether or not the series module will be displayed open by default or not. |
| `article.showHeadingAnchors` | `true` | Whether or not heading anchor links are displayed alongside headings within articles. |
| `article.showPagination` | `true` | Whether or not the next/previous article links are displayed in the article footer. |
| `article.invertPagination` | `false` | Whether or not to flip the direction of the next/previous article links. |
| `article.showReadingTime` | `true` | Whether or not article reading times are displayed. |
| `article.showTableOfContents` | `false` | Whether or not the table of contents is displayed on articles. |
| `article.showRelatedContent` | `false` | Display related content for each post. Might required additional configuration to your `config.toml`. Please check the theme `config.toml` if you want to enable this feature and copy all the relevant *related* entries. Also check [Hugo's docs](https://gohugo.io/content-management/related/) on related content. |
| `article.relatedContentLimit` | `3` | Limit of related articles to display if ` showRelatedContent` is turned on. |
| `article.showTaxonomies` | `false` | Whether or not the taxonomies related to this article are displayed. |
| `article.showAuthorsBadges` | `false` | Whether the `authors` taxonomies are are displayed in the article or list header. This requires the setup of `multiple authors` and the `authors` taxonomy. Check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature. |
| `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.showSummary` | `false` | Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration). |
| `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" |
### List
@@ -4,7 +4,7 @@ date: 2020-08-07
draft: false
description: "Learn how to deploy a Blowfish site."
slug: "hosting-deployment"
tags: ["hosting", "deployment", "docs", "github", "netlify", "render"]
tags: ["docs", "hosting", "deployment", "github", "netlify", "render"]
series: ["Documentation"]
series_order: 14
---
@@ -9,7 +9,7 @@
<div class="flex mb-6 px-4 py-2 mb-8 text-base rounded-md bg-primary-100 dark:bg-primary-900">
<span class="flex items-center justify-between grow dark:text-neutral-300">
<span class="prose dark:prose-invert">This is a demo of theme's list configurations: <code
id="config">card view with full width</code></span>
id="config">card view</code></span>
<button id="switch-config-button"
class="px-4 !text-neutral !no-underline rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700">
Switch config &orarr;
@@ -17,12 +17,12 @@
</span>
</div>
<div id="CardViewScreenWidth" class="">
{{ partial "recent-articles/cardview-fullwidth.html" . }}
<div id="CardViewProse" class="h-full">
{{ partial "recent-articles/cardview.html" . }}
</div>
<div id="CardViewProse" class="hidden h-full">
{{ partial "recent-articles/cardview.html" . }}
<div id="CardViewScreenWidth" class="hidden h-full">
{{ partial "recent-articles/cardview-fullwidth.html" . }}
</div>
<div id="NormalView" class="hidden h-full">
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB