mirror of https://github.com/jpanther/congo.git
✨ Add social sharing links
parent
fe7d59a855
commit
9fd42720fd
|
@ -17,6 +17,7 @@
|
||||||
showHeadingAnchors = true
|
showHeadingAnchors = true
|
||||||
showPagination = true
|
showPagination = true
|
||||||
showReadingTime = true
|
showReadingTime = true
|
||||||
|
# sharingLinks = ["facebook", "twitter", "reddit", "linkedin", "email"]
|
||||||
|
|
||||||
[list]
|
[list]
|
||||||
groupByYear = true
|
groupByYear = true
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"email": {
|
||||||
|
"icon": "email",
|
||||||
|
"title": "Send via email",
|
||||||
|
"url": "mailto:?body=%s&subject=%s"
|
||||||
|
},
|
||||||
|
"facebook": {
|
||||||
|
"icon": "facebook",
|
||||||
|
"title": "Share on Facebook",
|
||||||
|
"url": "https://www.facebook.com/sharer/sharer.php?u=%s"e=%s"
|
||||||
|
},
|
||||||
|
"linkedin": {
|
||||||
|
"icon": "linkedin",
|
||||||
|
"title": "Share on LinkedIn",
|
||||||
|
"url": "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s"
|
||||||
|
},
|
||||||
|
"reddit": {
|
||||||
|
"icon": "reddit",
|
||||||
|
"title": "Submit to Reddit",
|
||||||
|
"url": "https://reddit.com/submit/?url=%s&resubmit=true&title=%s"
|
||||||
|
},
|
||||||
|
"twitter": {
|
||||||
|
"icon": "twitter",
|
||||||
|
"title": "Tweet on Twitter",
|
||||||
|
"url": "https://twitter.com/intent/tweet/?url=%s&text=%s"
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,8 +16,9 @@
|
||||||
<section class="prose dark:prose-light">
|
<section class="prose dark:prose-light">
|
||||||
{{ .Content | emojify }}
|
{{ .Content | emojify }}
|
||||||
</section>
|
</section>
|
||||||
<footer>
|
<footer class="pt-8">
|
||||||
{{ partial "author.html" . }}
|
{{ partial "author.html" . }}
|
||||||
|
{{ partial "sharing-links.html" . }}
|
||||||
{{ partial "article-pagination.html" . }}
|
{{ partial "article-pagination.html" . }}
|
||||||
</footer>
|
</footer>
|
||||||
{{/* Comments */}}
|
{{/* Comments */}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
|
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
|
||||||
<div class="flex items-center pt-8">
|
<div class="flex items-center">
|
||||||
{{ with .Site.Author.image }}
|
{{ with .Site.Author.image }}
|
||||||
<img class="w-24 h-24 !mt-0 !mb-0 mr-4 rounded-full" src="{{ . }}" />
|
<img class="w-24 h-24 !mt-0 !mb-0 mr-4 rounded-full" src="{{ . }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
{{ with .Site.Params.article.sharingLinks }}
|
||||||
|
{{ $links := site.Data.sharing }}
|
||||||
|
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
|
||||||
|
{{ range . }}
|
||||||
|
{{ with index $links . }}
|
||||||
|
<a
|
||||||
|
class="bg-gray-300 text-gray-700 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-primary-400 dark:hover:text-gray-800 m-1 hover:bg-primary-500 hover:text-white rounded min-w-[2.4rem] inline-block text-center p-1"
|
||||||
|
href="{{ printf .url $.Permalink $.Title }}"
|
||||||
|
title="{{ .title }}"
|
||||||
|
>{{ partial "icon.html" .icon }}</a
|
||||||
|
>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue