summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/partials/article-meta
diff options
context:
space:
mode:
Diffstat (limited to 'themes/blowfish/layouts/partials/article-meta')
-rw-r--r--themes/blowfish/layouts/partials/article-meta/basic.html99
-rw-r--r--themes/blowfish/layouts/partials/article-meta/list.html36
-rw-r--r--themes/blowfish/layouts/partials/article-meta/taxonomy.html36
-rw-r--r--themes/blowfish/layouts/partials/article-meta/term.html36
4 files changed, 207 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/partials/article-meta/basic.html b/themes/blowfish/layouts/partials/article-meta/basic.html
new file mode 100644
index 0000000..40d12d5
--- /dev/null
+++ b/themes/blowfish/layouts/partials/article-meta/basic.html
@@ -0,0 +1,99 @@
+{{/* Determine the correct context and scope */}}
+{{/* This allows for different logic depending on where the partial is called */}}
+{{ $context := . }}
+{{ $scope := default nil }}
+
+{{ if (reflect.IsMap . ) }}
+ {{ $context = .context }}
+ {{ $scope = cond (not .scope) nil .scope }}
+{{ end }}
+
+{{ with $context }}
+{{ $meta := newScratch }}
+
+{{/* Gather partials for this context */}}
+{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
+ {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
+{{else if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
+{{ end }}
+
+{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
+"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
+{{ end }}
+
+{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
+ {{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
+{{ end }}
+
+{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0)
+}}
+ {{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
+{{ end }}
+
+{{ if and (not .Params.externalURL) (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
+{{ end }}
+
+{{ if and (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (.Params.showZenMode | default (.Site.Params.article.showZenMode | default false)) }}
+ {{ $meta.Add "partials" (slice (partial "meta/zen-mode.html" .)) }}
+{{ end }}
+
+
+<div class="flex flex-row flex-wrap items-center">
+ {{/* Output partials */}}
+ {{ with ($meta.Get "partials") }}
+ {{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
+ {{ end }}
+
+ {{/* Output draft label */}}
+ {{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }}
+ <span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
+ {{ end }}
+</div>
+
+{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }}
+<div class="flex flex-row flex-wrap items-center">
+ {{ range $taxonomy, $terms := .Site.Taxonomies }}
+ {{ if (eq $taxonomy "authors")}}
+ {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
+ {{ range $i, $a := $context.GetTerms $taxonomy }}
+ {{ if not (eq $i 0) }} ,&nbsp; {{ end }} <div style="cursor: pointer;" onclick="window.open({{ $a.RelPermalink }},'_self')">{{ $a.LinkTitle }}</div>
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+</div>
+{{ end }}
+
+{{/* Output taxonomies */}}
+{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }}
+<div class="flex flex-row flex-wrap items-center">
+ {{ range $taxonomy, $terms := .Site.Taxonomies }}
+ {{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series"))}}
+ {{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
+ {{ range $context.GetTerms $taxonomy }}
+ <span style="margin-top:0.5rem" class="mr-2" onclick="window.open({{ .RelPermalink }},'_self');">
+ {{ partial "badge.html" .LinkTitle }}
+ </span>
+ {{ end }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+</div>
+{{ end }}
+
+{{ end }} \ No newline at end of file
diff --git a/themes/blowfish/layouts/partials/article-meta/list.html b/themes/blowfish/layouts/partials/article-meta/list.html
new file mode 100644
index 0000000..4bf21c5
--- /dev/null
+++ b/themes/blowfish/layouts/partials/article-meta/list.html
@@ -0,0 +1,36 @@
+{{/* Determine the correct context and scope */}}
+{{/* This allows for different logic depending on where the partial is called */}}
+{{ $context := . }}
+{{ $scope := default nil }}
+
+{{ if (reflect.IsMap . ) }}
+{{ $context = .context }}
+{{ $scope = cond (not .scope) nil .scope }}
+{{ end }}
+
+{{ with $context }}
+{{ $meta := newScratch }}
+
+{{/* Gather partials for this context */}}
+
+{{ if (.Params.showViews | default (.Site.Params.list.showViews | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
+{{ end }}
+
+{{ if (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
+{{ end }}
+
+
+<div class="flex flex-row flex-wrap items-center">
+ {{/* Output partials */}}
+ {{ with ($meta.Get "partials") }}
+ {{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
+ {{ end }}
+</div>
+
+{{ end }} \ No newline at end of file
diff --git a/themes/blowfish/layouts/partials/article-meta/taxonomy.html b/themes/blowfish/layouts/partials/article-meta/taxonomy.html
new file mode 100644
index 0000000..add05bf
--- /dev/null
+++ b/themes/blowfish/layouts/partials/article-meta/taxonomy.html
@@ -0,0 +1,36 @@
+{{/* Determine the correct context and scope */}}
+{{/* This allows for different logic depending on where the partial is called */}}
+{{ $context := . }}
+{{ $scope := default nil }}
+
+{{ if (reflect.IsMap . ) }}
+{{ $context = .context }}
+{{ $scope = cond (not .scope) nil .scope }}
+{{ end }}
+
+{{ with $context }}
+{{ $meta := newScratch }}
+
+{{/* Gather partials for this context */}}
+
+{{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
+{{ end }}
+
+{{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
+{{ end }}
+
+
+<div class="flex flex-row flex-wrap items-center">
+ {{/* Output partials */}}
+ {{ with ($meta.Get "partials") }}
+ {{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
+ {{ end }}
+</div>
+
+{{ end }} \ No newline at end of file
diff --git a/themes/blowfish/layouts/partials/article-meta/term.html b/themes/blowfish/layouts/partials/article-meta/term.html
new file mode 100644
index 0000000..d5377dc
--- /dev/null
+++ b/themes/blowfish/layouts/partials/article-meta/term.html
@@ -0,0 +1,36 @@
+{{/* Determine the correct context and scope */}}
+{{/* This allows for different logic depending on where the partial is called */}}
+{{ $context := . }}
+{{ $scope := default nil }}
+
+{{ if (reflect.IsMap . ) }}
+{{ $context = .context }}
+{{ $scope = cond (not .scope) nil .scope }}
+{{ end }}
+
+{{ with $context }}
+{{ $meta := newScratch }}
+
+{{/* Gather partials for this context */}}
+
+{{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
+{{ end }}
+
+{{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
+{{ end }}
+
+{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
+{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
+{{ end }}
+
+
+<div class="flex flex-row flex-wrap items-center">
+ {{/* Output partials */}}
+ {{ with ($meta.Get "partials") }}
+ {{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
+ {{ end }}
+</div>
+
+{{ end }} \ No newline at end of file