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

View file

@ -2874,7 +2874,6 @@ select {
.to-transparent {
--tw-gradient-to: transparent var(--tw-gradient-to-position);
--tw-gradient-to-position: ;
}
.bg-clip-padding {
@ -4485,7 +4484,14 @@ body:has(#menu-controller:checked) {
}
.thumbnail_card {
height: 250px;
height: 200px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
}
.thumbnail_card_related {
height: 150px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;

View file

@ -348,7 +348,14 @@ body:has(#menu-controller:checked) {
}
.thumbnail_card {
height: 250px;
height: 200px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;
}
.thumbnail_card_related {
height: 150px;
background-repeat:no-repeat;
background-size:cover;
background-position:center;

View file

@ -33,3 +33,33 @@ buildFuture = false
[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

View file

@ -66,6 +66,8 @@ disableImageOptimization = false
invertPagination = false
showReadingTime = true
showTableOfContents = false
# showRelatedContent = false
# relatedContentLimit = 3
showTaxonomies = false
showAuthorsBadges = false
showWordCount = true

View file

@ -35,8 +35,8 @@ window.addEventListener("DOMContentLoaded", (event) => {
});
var list_config = [
"CardViewScreenWidth",
"CardViewProse",
"CardViewScreenWidth",
"NormalView"
]

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

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 --

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

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

View file

@ -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
---

View file

@ -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

View file

@ -24,6 +24,8 @@ article:
part_of_series: "Тази статия е част от поредица."
part: "Част"
this_article: "Тази Статия"
related_articles: "Related"
author:
byline_title: "Автор"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "লেখক"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "Tento článek patří do série."
part: "Část"
this_article: "Tento článek"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "Dieser Artikel ist Teil einer Serie."
part: "Teil"
this_article: "Dieser Artikel"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Author"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "Este artículo es parte de una serie."
part: "Parte"
this_article: "Este artículo"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Kirjoittaja"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "Cet article fait partie d'une série."
part: "Partie"
this_article: "Cet article"
related_articles: "Related"
author:
byline_title: "Auteur"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "מחבר"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Szerző"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Penulis"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Autore"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "著者"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -21,6 +21,7 @@ article:
part_of_series: "Este artigo faz parte de uma série de artigos."
part: "Parte"
this_article: "Esse Artigo"
related_articles: "Relacionados"
author:
byline_title: "Autor"

View file

@ -21,6 +21,7 @@ article:
part_of_series: "Este artigo faz parte de uma série."
part: "Parte"
this_article: "Este artigo"
related_articles: "Relacionados"
author:
byline_title: "Autor"

View file

@ -18,6 +18,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Autor"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Автор"

View file

@ -17,6 +17,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "Yazar"

View file

@ -24,6 +24,7 @@ article:
part_of_series: "Bài viết này là một phần của loạt bài."
part: "Phần"
this_article: "Bài viết này"
related_articles: "Related"
author:
byline_title: "Tác giả"

View file

@ -17,6 +17,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "作者"

View file

@ -17,6 +17,7 @@ article:
part_of_series: "This article is part of a series."
part: "Part"
this_article: "This Article"
related_articles: "Related"
author:
byline_title: "作者"

View file

@ -10,6 +10,14 @@
{{ end }}
{{- end -}}
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
@ -35,13 +43,7 @@
<div class="min-w-0 min-h-0 max-w-prose">
{{ .Content | emojify }}
</div>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</section>
{{ if gt .Pages 0 }}

View file

@ -3,16 +3,16 @@
<article>
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "partials/hero/" $heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "partials/hero/" $heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "partials/hero/basic.html" . }}
{{ end }}
{{ end }}
<header id="single_header" class="mt-5 max-w-prose">
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
@ -25,12 +25,15 @@
</div>
</header>
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<div class="order-first sm:max-w-prose lg:ml-auto px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if eq .Site.Params.header.layout "fixed" }} lg:top-[140px] {{ else }} lg:top-10 {{ end }}">
{{ partial "toc.html" . }}
</div>
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false) }} <div
class="order-first sm:max-w-prose lg:ml-auto px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if eq .Site.Params.header.layout " fixed" }}
lg:top-[140px] {{ else }} lg:top-10 {{ end }}">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} {{ partial "toc.html" . }} {{ end }} {{ if .Site.Params.article.showRelatedPosts |
default false }} sd {{ end }} </div>
</div>
{{ end }}
<div class="min-w-0 min-h-0 max-w-prose">
@ -56,7 +59,7 @@
{{ $baseURL := .Site.BaseURL }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }}
{{ range $author := .Page.Params.authors }}
@ -75,6 +78,9 @@
{{ end }}
{{ partial "sharing-links.html" . }}
{{ partial "related.html" . }}
{{ partial "article-pagination.html" . }}
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }}
{{ if templates.Exists "partials/comments.html" }}

View file

@ -0,0 +1,72 @@
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ with .Params.externalUrl }}
<a href="{{ . }}" target="_blank" rel="external" class="min-w-full">
{{ else }}
<a href="{{ .RelPermalink }}" class="min-w-full">
{{ end }}
<div class="min-h-full border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative backdrop-blur">
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="w-full thumbnail_card_related nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="w-full thumbnail_card_related nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
{{- end -}}
{{- end -}}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="absolute top-0 right-0 m-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</span>
{{ end }}
<div class="px-6 py-4">
{{ with .Params.externalUrl }}
<div>
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
{{ $.Title | emojify }}
<span class="text-xs align-top cursor-default text-neutral-400 dark:text-neutral-500">
<span class="rtl:hidden">&#8599;</span>
<span class="ltr:hidden">&#8598;</span>
</span>
</div>
</div>
{{ else }}
<div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</div>
{{ end }}
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="py-1 prose dark:prose-invert">
{{ .Summary | emojify }}
</div>
{{ end }}
</div>
<div class="px-6 pt-4 pb-2">
</div>
</div>
</a>

View file

@ -0,0 +1,11 @@
{{ if .Params.showRelatedContent | default (.Site.Params.article.showRelatedContent | default false)}}
{{ $related := .Site.RegularPages.Related . | first .Site.Params.article.relatedContentLimit }}
{{ with $related }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "article.related_articles" | emojify }}</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range . }}
{{ partial "article-link/card-related.html" . }}
{{ end }}
</section>
{{ end }}
{{ end }}