mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
132 lines
6.3 KiB
HTML
132 lines
6.3 KiB
HTML
{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}}
|
|
|
|
{{- define "content" -}}
|
|
{{- $params := .Scratch.Get "params" -}}
|
|
{{- $toc := .Scratch.Get "toc" -}}
|
|
|
|
<aside class="toc" id="toc-auto">
|
|
{{- /* Auto TOC */ -}}
|
|
{{- $tocEmpty := eq .TableOfContents `<nav id="TableOfContents"></nav>` -}}
|
|
{{- if (ne $toc.enable false) | and (ne $tocEmpty true) -}}
|
|
<h2 class="toc-title">{{ T "contents" }}</h2>
|
|
<div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div>
|
|
{{- end -}}
|
|
</aside>
|
|
|
|
<aside class="aside-custom">
|
|
<!-- put aside for later use -->
|
|
</aside>
|
|
|
|
<article class="page single">
|
|
{{- /* Title */ -}}
|
|
<h1 class="single-title animate__animated animate__flipInX">{{ .Title }}</h1>
|
|
|
|
{{- /* Subtitle */ -}}
|
|
{{- with $params.subtitle -}}
|
|
<h2 class="single-subtitle">{{ . }}</h2>
|
|
{{- end -}}
|
|
|
|
{{- /* Meta */ -}}
|
|
<div class="post-meta">
|
|
<div class="post-meta-line">
|
|
{{- partial "single/post-author.html" . -}}
|
|
|
|
{{- $categories := slice -}}
|
|
{{- range .Params.categories -}}
|
|
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
|
|
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i> %v</a>` $category.RelPermalink $category.Title) -}}
|
|
{{- end -}}
|
|
{{- with delimit $categories " " }}
|
|
<span class="post-category">
|
|
{{- dict "Categories" . | T "includedInCategories" | safeHTML -}}
|
|
</span>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="post-meta-line">
|
|
{{- with .Site.Params.dateformat | default "2006-01-02" | .PublishDate.Format -}}
|
|
<span title={{ "2006-01-02 15:04:05" | $.PublishDate.Format }}>
|
|
<i class="far fa-calendar-alt fa-fw"></i> <time datetime="{{ . }}" >{{ . }}</time>
|
|
</span>
|
|
{{- end -}}
|
|
<i class="fas fa-pencil-alt fa-fw"></i> {{ T "wordCount" .WordCount }}
|
|
<i class="far fa-clock fa-fw"></i> {{ T "readingTime" .ReadingTime }}
|
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
|
{{- /* Visitor Count */ -}}
|
|
{{- if $comment.enable -}}
|
|
{{- if ($comment.valine.enable | and $comment.valine.visitor) | or ($comment.waline.enable | and $comment.waline.visitor) -}}
|
|
{{- /* Warning: waline v2 will not be compatible with valine */ -}}
|
|
<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-eye fa-fw"></i> <span class="leancloud-visitors-count">-</span> {{ T "views" }}
|
|
</span>
|
|
{{- else if $comment.waline.enable | and $comment.waline.visitor -}}
|
|
<span class="comment-visitors" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-eye fa-fw"></i> <span id="{{ .RelPermalink }}" class="waline-visitor-count">-</span> {{ T "views" }}
|
|
</span>
|
|
{{- else if $comment.twikoo.enable | and $comment.twikoo.visitor -}}
|
|
<span id="{{ .RelPermalink }}" class="comment-visitors" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-eye fa-fw"></i> <span id="twikoo_visitors">-</span> {{ T "views" }}
|
|
</span>
|
|
{{- end -}}
|
|
{{- else if .Site.Params.ibruce.enable | and .Site.Params.ibruce.enablePost -}}
|
|
<span id="busuanzi_container_page_pv" class="busuanzi_visitors" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-eye fa-fw"></i> <span id="busuanzi_value_page_pv">-</span> {{ T "views" }}
|
|
</span>
|
|
{{- end -}}
|
|
{{- /* Comment Count */ -}}
|
|
{{- if $comment.enable -}}
|
|
{{- if $comment.valine.enable | and $comment.valine.commentCount -}}
|
|
<span class="comment-count" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-comments fa-fw"></i> <span data-xid="{{ .RelPermalink }}" class="valine-comment-count">-</span> {{ T "comments" }}
|
|
</span>
|
|
{{- else if $comment.waline.enable | and $comment.waline.commentCount -}}
|
|
<span class="comment-count" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-comments fa-fw"></i> <span id="{{ .RelPermalink }}" class="waline-comment-count">-</span> {{ T "comments" }}
|
|
</span>
|
|
{{- else if $comment.twikoo.enable | and $comment.twikoo.commentCount -}}
|
|
<span id="{{ .RelPermalink }}" class="comment-count" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-comments fa-fw"></i> <span id="twikoo-comment-count">-</span> {{ T "comments" }}
|
|
</span>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
|
|
{{- /* Featured image */ -}}
|
|
{{- $image := $params.featuredimage -}}
|
|
{{- with .Resources.GetMatch "featured-image" -}}
|
|
{{- $image = .RelPermalink -}}
|
|
{{- end -}}
|
|
{{- with $image -}}
|
|
<div class="featured-image">
|
|
{{- dict "Src" . "Title" $.Description "Resources" $.Resources | partial "plugin/image.html" -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Static TOC */ -}}
|
|
{{- if (ne $toc.enable false) | and (ne $tocEmpty true) -}}
|
|
<div class="details toc" id="toc-static" kept="{{ if $toc.keepStatic }}true{{ else }}false{{ end }}">
|
|
<div class="details-summary toc-title">
|
|
<span>{{ T "contents" }}</span>
|
|
<span><i class="details-icon fas fa-angle-right"></i></span>
|
|
</div>
|
|
<div class="details-content toc-content" id="toc-content-static">
|
|
{{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Content */ -}}
|
|
<div class="content" id="content">
|
|
{{- /* Expiration Reminder */ -}}
|
|
{{- partial "single/expiration-reminder.html" . -}}
|
|
{{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
|
</div>
|
|
|
|
{{- /* Footer */ -}}
|
|
{{- partial "single/footer.html" . -}}
|
|
|
|
{{- /* Comment */ -}}
|
|
{{- partial "single/comment.html" . -}}
|
|
</article>
|
|
{{- end -}}
|