diff options
Diffstat (limited to 'layouts/partials/single')
10 files changed, 84 insertions, 0 deletions
diff --git a/layouts/partials/single/components/comments/comments.html b/layouts/partials/single/components/comments/comments.html new file mode 100644 index 0000000..2eae412 --- /dev/null +++ b/layouts/partials/single/components/comments/comments.html @@ -0,0 +1,11 @@ +{{ if .IsPage }} + <!-- giscus --> + {{ if .Site.Params.giscus.enable }} + {{ partial "single/components/comments/giscus" . }} + {{ end }} + + <!-- disqus --> + {{ if .Site.Params.disqusShortname }} + {{ partial "single/components/comments/disqus" . }} + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/single/components/comments/disqus.html b/layouts/partials/single/components/comments/disqus.html new file mode 100644 index 0000000..b794098 --- /dev/null +++ b/layouts/partials/single/components/comments/disqus.html @@ -0,0 +1,4 @@ +<div class="disqus-comment"> + {{/* https://gohugo.io/templates/internal/#disqus */}} + {{- template "_internal/disqus.html" . -}} +</div>
\ No newline at end of file diff --git a/layouts/partials/single/components/comments/giscus.html b/layouts/partials/single/components/comments/giscus.html new file mode 100644 index 0000000..4daa23a --- /dev/null +++ b/layouts/partials/single/components/comments/giscus.html @@ -0,0 +1,21 @@ +<div class="giscus-comment"> + <script + src="https://giscus.app/client.js" + data-repo="{{ .Site.Params.giscus.repo }}" + data-repo-id="{{ .Site.Params.giscus.repoId }}" + data-category="{{ .Site.Params.giscus.category }}" + data-category-id="{{ .Site.Params.giscus.categoryId }}" + data-mapping="{{ .Site.Params.giscus.mapping | default `pathname` }}" + data-strict="{{ (string .Site.Params.giscus.strict) | default 0 }}" + data-reactions-enabled="{{ (string .Site.Params.giscus.reactionsEnabled) | default 1 }}" + data-emit-metadata="{{ (string .Site.Params.giscus.emitMetadata) | default 0 }}" + data-input-position="{{ .Site.Params.giscus.inputPosition | default `top` }}" + data-theme="{{ .Site.Params.giscus.theme | default `light` }}" + data-lang="{{ .Site.Params.giscus.lang | default `en` }}" + {{ if .Site.Params.giscus.lazyLoading }} + data-loading="lazy" + {{ end }} + crossorigin="anonymous" + async + ></script> +</div>
\ No newline at end of file diff --git a/layouts/partials/single/components/metatag/categories.html b/layouts/partials/single/components/metatag/categories.html new file mode 100644 index 0000000..1d0f808 --- /dev/null +++ b/layouts/partials/single/components/metatag/categories.html @@ -0,0 +1,8 @@ +{{ with (.GetTerms "categories") }} + — + {{ range . }} + <a class="hover:text-gray-500" href="{{ .RelPermalink }}" alt="{{ .LinkTitle }}" > + {{ .LinkTitle }} + </a> + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/single/components/metatag/tags.html b/layouts/partials/single/components/metatag/tags.html new file mode 100644 index 0000000..800ebc2 --- /dev/null +++ b/layouts/partials/single/components/metatag/tags.html @@ -0,0 +1,9 @@ +{{ with (.GetTerms "tags") }} + <div class="pb-14 taxonomy-list tags-list text-gray-600 text-sm font-medium"> + {{ range . }} + <a class="bg-gray-100 py-2 px-3 rounded-lg" href="{{ .RelPermalink }}" alt="{{ .LinkTitle }}" > + {{ .LinkTitle }} + </a> + {{ end }} + </div> +{{ end }} diff --git a/layouts/partials/single/components/metatag/time.html b/layouts/partials/single/components/metatag/time.html new file mode 100644 index 0000000..4575fc0 --- /dev/null +++ b/layouts/partials/single/components/metatag/time.html @@ -0,0 +1,4 @@ +{{- $pubdate := .PublishDate.Format "2 January 2006" }} +<time datetime="{{ .PublishDate }}" title="{{ .PublishDate }}"> + {{ $pubdate }} +</time>
\ No newline at end of file diff --git a/layouts/partials/single/components/title/large.html b/layouts/partials/single/components/title/large.html new file mode 100644 index 0000000..20b9b3f --- /dev/null +++ b/layouts/partials/single/components/title/large.html @@ -0,0 +1 @@ +<h2 class="text-4xl leading-snug font-bold text-gray-900">{{ .Title }}</h2> diff --git a/layouts/partials/single/components/title/small.html b/layouts/partials/single/components/title/small.html new file mode 100644 index 0000000..bda0a1e --- /dev/null +++ b/layouts/partials/single/components/title/small.html @@ -0,0 +1 @@ +<h2 class="text-2xl font-extrabold text-gray-900">{{ .Title }}</h2>
\ No newline at end of file diff --git a/layouts/partials/single/default.html b/layouts/partials/single/default.html new file mode 100644 index 0000000..2d2ad63 --- /dev/null +++ b/layouts/partials/single/default.html @@ -0,0 +1,17 @@ +<article class="flex flex-col gap-10"> + <header class="flex flex-col gap-2"> + {{ partial "single/components/title/large" . }} + <div class="text-sm font-semibold text-gray-500 flex gap-3"> + {{ partial "single/components/metatag/time" . }} + {{ partial "single/components/metatag/categories" . }} + </div> + </header> + <section class="content text-lg text-gray-800"> + {{/* {{.TableOfContents}} */}} + {{ .Content | emojify }} + </section> + {{ partial "single/components/comments/comments" . }} + <footer> + {{ partial "single/components/metatag/tags" . }} + </footer> +</article>
\ No newline at end of file diff --git a/layouts/partials/single/homepage.html b/layouts/partials/single/homepage.html new file mode 100644 index 0000000..2e80535 --- /dev/null +++ b/layouts/partials/single/homepage.html @@ -0,0 +1,8 @@ +<article class="flex flex-col gap-5"> + <header class="flex flex-col gap-2"> + {{ partial "single/components/title/small" . }} + </header> + <section class="content text-lg text-gray-800"> + {{ .Content | emojify }} + </section> +</article>
\ No newline at end of file |
