2020-09-23 12:52:32 +05:30
|
|
|
{{- define "main" }}
|
2019-04-01 16:00:48 +08:00
|
|
|
|
2019-03-31 20:32:06 +08:00
|
|
|
<article class="post-single">
|
2018-01-09 00:28:39 +08:00
|
|
|
<header class="post-header">
|
2021-01-29 23:37:07 +05:30
|
|
|
{{- if (.Param "ShowBreadCrumbs")}}
|
|
|
|
<div class="breadcrumbs">
|
|
|
|
{{- $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
|
|
|
{{- $lang_url := replace $url ( printf "%s" .Lang) "" }}
|
|
|
|
|
|
|
|
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home"}}</a>
|
|
|
|
{{- range $index, $element := split $lang_url "/" }}
|
|
|
|
|
|
|
|
{{- $.Scratch.Add "path" (printf "%s/" $element )}}
|
|
|
|
{{- $bc_pg := $.Site.GetPage ($.Scratch.Get "path") -}}
|
|
|
|
|
|
|
|
{{- if (and ($bc_pg) (gt (len . ) 0))}}
|
|
|
|
{{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
{{- end }}
|
2020-07-24 20:46:33 +05:30
|
|
|
<h1 class="post-title">
|
|
|
|
{{ .Title }}
|
2020-07-28 12:36:53 +05:30
|
|
|
{{- if .Draft }}<div class="entry-isdraft"><sup> [draft]</sup></div>{{- end }}
|
2020-07-24 20:46:33 +05:30
|
|
|
</h1>
|
2021-01-28 20:35:45 +05:30
|
|
|
{{- if .Description }}
|
2021-01-02 09:00:20 -08:00
|
|
|
<div class="post-description">
|
|
|
|
{{ .Description }}
|
|
|
|
</div>
|
2021-01-28 20:35:45 +05:30
|
|
|
{{- end }}
|
2021-01-17 07:55:35 +01:00
|
|
|
{{- if not (.Param "hideMeta") }}
|
2019-03-31 20:32:06 +08:00
|
|
|
<div class="post-meta">
|
2020-10-20 18:38:29 +05:30
|
|
|
{{- partial "post_meta.html" . -}}
|
2021-01-24 13:22:45 +01:00
|
|
|
{{- if .IsTranslated -}}
|
2021-01-24 18:07:17 +05:30
|
|
|
{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}}
|
2020-09-22 13:41:23 +05:30
|
|
|
<ul class="i18n_list">
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- i18n "translations" | default "Translations"}}:
|
|
|
|
{{- range .Translations }}
|
2020-09-22 13:41:23 +05:30
|
|
|
<li>
|
2020-11-08 23:04:24 +05:30
|
|
|
<a href="{{ .Permalink }}">
|
|
|
|
{{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }}
|
2020-11-08 23:07:23 +05:30
|
|
|
{{- .Language.LanguageName | emojify | humanize -}}
|
2020-11-08 23:04:24 +05:30
|
|
|
{{- else }}
|
|
|
|
{{- .Lang | humanize -}}
|
|
|
|
{{- end -}}
|
|
|
|
</a>
|
2020-09-22 13:41:23 +05:30
|
|
|
</li>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2020-09-22 13:41:23 +05:30
|
|
|
</ul>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2019-03-31 20:32:06 +08:00
|
|
|
</div>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end}}
|
2018-01-09 00:28:39 +08:00
|
|
|
</header>
|
2021-01-22 01:22:00 -05:00
|
|
|
{{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden}}
|
2020-12-29 16:44:03 +05:30
|
|
|
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
|
2021-01-17 07:55:35 +01:00
|
|
|
{{- if (.Param "ShowToc") }}
|
2020-07-24 23:53:25 +05:30
|
|
|
<div class="toc">
|
2021-01-17 07:55:35 +01:00
|
|
|
<details {{if (.Param "TocOpen") }} open{{ end }}>
|
2020-12-18 20:02:05 +05:30
|
|
|
<summary accesskey="c" title="(Alt + C)">
|
|
|
|
<div class="details">{{- i18n "toc" | default "Table of Contents" }}</div>
|
2020-07-24 23:53:25 +05:30
|
|
|
</summary>
|
2021-01-23 23:38:51 +05:30
|
|
|
<div class="inner">
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- partial "toc.html" . }}
|
2021-01-23 23:38:51 +05:30
|
|
|
</div>
|
2020-07-24 23:53:25 +05:30
|
|
|
</details>
|
|
|
|
</div>
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2020-11-10 12:15:56 +05:30
|
|
|
<div class="post-content">
|
|
|
|
{{- partial "anchored_headings.html" .Content -}}
|
|
|
|
</div>
|
2018-01-09 00:28:39 +08:00
|
|
|
<footer class="post-footer">
|
2020-08-23 16:35:53 +05:30
|
|
|
{{- if .Params.tags }}
|
2018-01-09 00:28:39 +08:00
|
|
|
<ul class="post-tags">
|
2020-12-10 21:58:09 -08:00
|
|
|
{{- range ($.GetTerms "tags") }}
|
|
|
|
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
2020-03-09 23:56:47 +08:00
|
|
|
{{- end }}
|
2018-01-09 00:28:39 +08:00
|
|
|
</ul>
|
2020-08-23 16:35:53 +05:30
|
|
|
{{- end }}
|
2021-01-28 00:05:30 +05:30
|
|
|
{{- if .Site.Params.ShowPostNavLinks }}
|
|
|
|
{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
|
|
|
{{- if and (gt (len $pages) 1) (in $pages . ) }}
|
|
|
|
<nav class="paginav">
|
|
|
|
{{- with $pages.Next . }}
|
|
|
|
<a class="prev" href="{{.Permalink}}">
|
|
|
|
<span class="title">« {{ i18n "prev_page" }}</span>
|
|
|
|
<br>
|
|
|
|
<span>{{- .Name -}}</span>
|
|
|
|
</a>
|
|
|
|
{{- end}}
|
|
|
|
{{- with $pages.Prev . }}
|
|
|
|
<a class="next" href="{{.Permalink}}">
|
|
|
|
<span class="title">{{ i18n "next_page" }} »</span>
|
|
|
|
<br>
|
|
|
|
<span>{{- .Name -}}</span>
|
|
|
|
</a>
|
|
|
|
{{- end}}
|
|
|
|
</nav>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true) ) }}
|
2020-09-23 18:23:57 +05:30
|
|
|
{{- partial "share_icons.html" . }}
|
2020-09-23 12:52:32 +05:30
|
|
|
{{- end }}
|
2018-01-09 00:28:39 +08:00
|
|
|
</footer>
|
2020-07-20 20:11:58 +05:30
|
|
|
|
2021-01-17 07:55:35 +01:00
|
|
|
{{- if (.Param "comments") }}
|
2020-07-20 20:11:58 +05:30
|
|
|
{{- partial "comments.html" . }}
|
2020-03-09 23:56:47 +08:00
|
|
|
{{- end }}
|
2018-01-09 00:28:39 +08:00
|
|
|
</article>
|
2019-04-01 16:00:48 +08:00
|
|
|
|
2020-10-22 13:12:26 +02:00
|
|
|
{{- end }}{{/* end main */}}
|