mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-25 08:16:19 +01:00
c2197b7411
* replace forkawesome and iconfont with simple icons * add more configs for social
99 lines
4.5 KiB
HTML
99 lines
4.5 KiB
HTML
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
|
|
|
{{- define "content" -}}
|
|
{{- $params := .Scratch.Get "params" -}}
|
|
|
|
{{- /* Auto TOC */ -}}
|
|
{{- if ne $params.toc.enable false -}}
|
|
<div class="toc" id="toc-auto">
|
|
<h2 class="toc-title">{{ T "contents" }}</h2>
|
|
<div class="toc-content{{ if eq $params.toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
<article class="page single">
|
|
{{- /* Title */ -}}
|
|
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
|
|
|
{{- /* Subtitle */ -}}
|
|
{{- with $params.subtitle -}}
|
|
<h2 class="single-subtitle">{{ . }}</h2>
|
|
{{- end -}}
|
|
|
|
{{- /* Meta */ -}}
|
|
<div class="post-meta">
|
|
<div class="post-meta-line">
|
|
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
|
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
|
<span class="post-author">
|
|
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
|
{{- partial "plugin/link.html" $options -}}
|
|
</span>
|
|
|
|
{{- with $params.categories -}}
|
|
|
|
<span class="post-category">
|
|
{{- T "included" -}}
|
|
{{- range $index, $value := . -}}
|
|
{{- if gt $index 0 }} {{ end -}}
|
|
{{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}}
|
|
<a href="{{ $category.RelPermalink }}">
|
|
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
|
|
</a>
|
|
{{- end -}}
|
|
</span>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="post-meta-line">
|
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateformat | 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 }}
|
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
|
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
|
<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>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
|
|
{{- /* Featured image */ -}}
|
|
{{- with $params.featuredimage -}}
|
|
<div class="featured-image">
|
|
{{- partial "plugin/image.html" (dict "src" . "alt" $.Description "large" true) -}}
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Static TOC */ -}}
|
|
{{- if $params.toc.enable -}}
|
|
<div class="toc" id="toc-static">
|
|
<details>
|
|
<summary>
|
|
<div class="toc-title">
|
|
<span>{{ T "contents" }}</span>
|
|
<span><i class="details icon fas fa-angle-down"></i></span>
|
|
</div>
|
|
</summary>
|
|
<div class="toc-content" id="toc-content-static">
|
|
{{- $toc := .TableOfContents -}}
|
|
{{- $toc = partial "function/fontawesome.html" $toc -}}
|
|
{{- $toc = partial "function/ruby.html" $toc -}}
|
|
{{- $toc | safeHTML -}}
|
|
</div>
|
|
</details>
|
|
</div>
|
|
{{- end -}}
|
|
|
|
{{- /* Content */ -}}
|
|
<div class="content" id="content">
|
|
{{- 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 "comment.html" . -}}
|
|
</article>
|
|
{{- end -}}
|