mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-22 14:56:19 +01:00
90 lines
4 KiB
HTML
90 lines
4 KiB
HTML
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
|
|
|
{{- define "content" -}}
|
|
<article class="page single">
|
|
{{- /* Title */ -}}
|
|
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
|
|
|
{{- /* Meta */ -}}
|
|
<div class="post-meta">
|
|
<div class="post-meta-line">
|
|
{{- $author := .Params.author | default .Site.Author.name -}}
|
|
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
|
<span class="post-author">
|
|
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
|
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
|
</a>
|
|
</span>
|
|
|
|
{{- with .Params.categories -}}
|
|
<span class="post-category">
|
|
{{- T "included" -}}
|
|
{{- range . -}}
|
|
|
|
<span>
|
|
<a href="{{ `/categories/` | relLangURL }}{{ urlize .}}">
|
|
<i class="far fa-folder fa-fw"></i>{{ . | humanize }}
|
|
</a>
|
|
</span>
|
|
{{- end -}}
|
|
</span>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="post-meta-line">
|
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
|
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
|
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
|
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
|
{{- if .Scratch.Get "production" | and .Site.Params.valine.enable | and .Site.Params.valine.visitor -}}
|
|
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
|
<i class="far fa-eye fa-fw"></i>{{ T "pageviews" | safeHTML }}
|
|
</span>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
|
|
{{- /* Featured image */ -}}
|
|
{{- with .Params.featuredImage -}}
|
|
<div class="featured-image">
|
|
{{- partial "function/image.html" (dict "src" . "alt" "featured image") -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* TOC */ -}}
|
|
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
|
<div class="toc-auto" id="toc-auto">
|
|
<h2 class="toc-title">{{ T "toc" }}</h2>
|
|
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
|
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
|
|
</div>
|
|
<div class="toc-static" id="toc-static">
|
|
<details>
|
|
<summary>
|
|
<div class="toc-title">
|
|
<span>{{ T "toc" }}</span>
|
|
<span><i class="details icon fas fa-angle-down"></i></span>
|
|
</div>
|
|
</summary>
|
|
<div class="toc-content" id="toc-content-static">
|
|
{{- .TableOfContents -}}
|
|
</div>
|
|
</details>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Content */ -}}
|
|
<div class="content">
|
|
{{- partial "function/content.html" .Content -}}
|
|
</div>
|
|
|
|
{{- /* Footer */ -}}
|
|
{{- partial "post/footer.html" . -}}
|
|
|
|
{{- /* Comment */ -}}
|
|
<div class="comment">
|
|
{{- if ( .Params.comment | default true ) -}}
|
|
{{- partial "comment.html" . -}}
|
|
{{- end -}}
|
|
</div>
|
|
</article>
|
|
{{- end -}}
|