You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
4.6 KiB
107 lines
4.6 KiB
{{ define "main" }}
|
|
<main class="post">
|
|
|
|
<div class="container-fluid header px-0">
|
|
{{ with .Params.Image }}
|
|
<img class="post-cover" src="{{ . }}" />
|
|
{{ end }}
|
|
<div class="white-block"></div>
|
|
</div>
|
|
|
|
<div class="container-fluid move-up">
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-xl-7 col-lg-7 col-md-12 col-12 pt-5 cutoff">
|
|
|
|
<article>
|
|
<p class="mb-0">{{ .Params.categories }}</p>
|
|
|
|
<h1 class="post-title">{{ .Title | markdownify }}</h1>
|
|
|
|
<p>by
|
|
{{ range .Param "authors" }}
|
|
{{ $name := . }}
|
|
{{ $path := printf "/%s/%s" "authors" ($name | urlize) }}
|
|
{{ with $.Site.GetPage $path }}
|
|
<a href="{{ .Params.website }}" target="_blank" rel="noopener noreferrer">{{ .Params.name }}</a>
|
|
{{ end }}
|
|
{{ end }}
|
|
<span class="ms-5"><time datetime="{{ .Date.Format .Site.Params.dateform }}">{{ .Date.Format .Site.Params.dateform }}</time></span>
|
|
<span class="ms-5">{{ i18n "readingTime" .Page.ReadingTime }}</span><span class="ms-5">{{ i18n "wordCount" .Page.WordCount }}</span>
|
|
</p>
|
|
|
|
{{- if .Params.toc }}
|
|
<hr />
|
|
<aside id="toc">
|
|
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
|
|
{{ .TableOfContents }}
|
|
</aside>
|
|
<hr />
|
|
{{- end }}
|
|
|
|
<div class="post-content">
|
|
{{ $content := .Content }}
|
|
{{ $content = replaceRE `(<h[1-6] id=\"(.+)\".*>)(.*)(</h[1-6]>)` `${1}${3}<a class="anchor-tag" href="#${2}">#</a>${4}` $content | safeHTML }}
|
|
{{ $content | safeHTML }}
|
|
</div>
|
|
</article>
|
|
|
|
<div class="post-info">
|
|
{{- with .Params.tags }}
|
|
<p>
|
|
{{- range . -}}
|
|
<span class="tag"><a href="{{ "/tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>
|
|
{{- end }}
|
|
</p>
|
|
{{- end }}
|
|
|
|
|
|
<p>{{ i18n "publishDate" . }}
|
|
{{ if .Site.Params.dateformNumTime }}<time datetime="{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}">{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}</time>{{ else }}<time datetime="{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}">{{ dateFormat "2006-01-02 15:04" .Date.Local }}</time>{{ end }}
|
|
{{ if ne .PublishDate .Lastmod }}, {{ i18n "updatedOn" . }}
|
|
<time datetime="{{ .Date.Format .Site.Params.dateformNumTime }}">{{ .Lastmod.Format "2006-01-02 15:04" }}</time>{{ end }}
|
|
</p>
|
|
|
|
{{- if .GitInfo }}
|
|
<p><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank"
|
|
rel="noopener" title="Commit message: {{ .GitInfo.Subject}}">{{ .GitInfo.AbbreviatedHash }}</a> @
|
|
{{ if .Site.Params.dateformNum }}<time datetime="{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}">{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</time>{{ else }}<time datetime="{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}">{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}</time>{{ end }}
|
|
</p>
|
|
{{- end }}
|
|
</div>
|
|
|
|
{{ if and (not $.Site.Params.DisableReadOtherPosts) (or .NextInSection .PrevInSection) }}
|
|
<div class="pagination">
|
|
<div class="pagination__title">
|
|
<span class="pagination__title-h">Read Other Posts</span>
|
|
<hr />
|
|
</div>
|
|
|
|
<div class="pagination__buttons">
|
|
{{ if .NextInSection }}
|
|
<span class="button previous">
|
|
<a href="{{ .NextInSection.Permalink }}">
|
|
<span class="button__icon">←</span>
|
|
<span class="button__text">{{ .NextInSection.Title }}</span>
|
|
</a>
|
|
</span>
|
|
{{ end }}
|
|
|
|
{{ if .PrevInSection }}
|
|
<span class="button next">
|
|
<a href="{{ .PrevInSection.Permalink }}">
|
|
<span class="button__text">{{ .PrevInSection.Title }}</span>
|
|
<span class="button__icon">→</span>
|
|
</a>
|
|
</span>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</main>
|
|
{{ end }}
|