🐛 fix for sharing links parameter in params.toml config file

This commit is contained in:
Nuno Coração 2023-01-01 21:32:56 +00:00
parent 7db7ee8034
commit caa8476e35
4 changed files with 44 additions and 45 deletions

View file

@ -65,7 +65,7 @@ enableCodeCopy = true
showAuthorsBadges = false
showWordCount = true
showSummary = true
sharingLinks = [ "linkedin", "twitter", "whatsapp", "pinterest", "reddit", "facebook", "email"]
sharingLinks = [ "linkedin", "twitter", "reddit", "pinterest", "facebook", "email"]
[list]
#showHero = true

View file

@ -1,5 +1,4 @@
{
"links": {
"email": {
"icon": "email",
"title": "sharing.email",
@ -30,5 +29,4 @@
"title": "sharing.twitter",
"url": "https://twitter.com/intent/tweet/?url=%s&text=%s"
}
}
}

View file

@ -64,7 +64,7 @@ defaultBackgroundImage = "/img/iceland.jpg"
showAuthorsBadges = true
showWordCount = false
showSummary = true
sharingLinks = [ "linkedin", "twitter", "whatsapp", "pinterest", "reddit", "facebook", "email"]
sharingLinks = [ "linkedin", "twitter", "reddit", "pinterest", "facebook", "email"]
[list]
showHero = true

View file

@ -1,7 +1,8 @@
{{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }}
{{ $links := site.Data.sharing }}
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
{{ range $.Site.Data.sharing.links }}
{{ with . }}
{{ range . }}
{{ with index $links . }}
<a
target="_blank"
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"