mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
89 lines
No EOL
4.1 KiB
HTML
89 lines
No EOL
4.1 KiB
HTML
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
|
|
|
{{- define "content" -}}
|
|
<article class="page">
|
|
{{- /* Title */ -}}
|
|
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
|
|
|
{{- /* Meta */ -}}
|
|
<div class="post-meta">
|
|
<div class="post-meta-main">
|
|
{{- $author := .Params.author | default .Site.Author.name -}}
|
|
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
|
|
<a class="author" href="{{ $author_link }}" rel="author" target="_blank">
|
|
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
|
</a>
|
|
{{- with .Params.categories -}}
|
|
<span class="post-category">
|
|
{{- T "included" -}}
|
|
{{- range . -}}
|
|
{{- $name := . -}}
|
|
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
|
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</span>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="post-meta-other">
|
|
{{- $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 eq (getenv "HUGO_ENV") "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.featured_image -}}
|
|
<div class="post-featured-image">
|
|
{{- partial "image" . -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* TOC */ -}}
|
|
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
|
<div class="post-toc" id="post-toc">
|
|
<h2 class="post-toc-title">{{ T "toc" }}</h2>
|
|
{{- $globalAutoCollapseToc := .Site.Params.auto_collapse_toc | default true }}
|
|
<div class="post-toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.auto_collapse_toc false)) }} always-active{{ end }}">
|
|
{{- .TableOfContents -}}
|
|
</div>
|
|
</div>
|
|
<div class="post-toc-mobile" id="post-toc-mobile">
|
|
<details>
|
|
<summary>
|
|
<div class="post-toc-title">
|
|
<span>{{ T "toc" }}</span>
|
|
<span><i class="details icon fas fa-angle-down"></i></span>
|
|
</div>
|
|
</summary>
|
|
<div class="post-toc-content">
|
|
{{- $toc := .TableOfContents -}}
|
|
{{- $toc = replaceRE `id="TableOfContents"` `id="TableOfContentsMobile"` $toc -}}
|
|
{{- $toc | safeHTML -}}
|
|
</div>
|
|
</details>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Content */ -}}
|
|
<div class="post-content">
|
|
{{- partial "hook/content.html" .Content | safeHTML -}}
|
|
</div>
|
|
|
|
{{- /* Footer */ -}}
|
|
{{- partial "post/footer.html" . -}}
|
|
|
|
{{- /* Comment */ -}}
|
|
<div class="post-comment">
|
|
{{- if ( .Params.comment | default true ) -}}
|
|
{{- partial "comments.html" . -}}
|
|
{{- end -}}
|
|
</div>
|
|
</article>
|
|
{{- end -}} |