1
0
mirror of https://github.com/avinal/avinal.github.io.git synced 2026-07-03 23:30:09 +05:30
Files
avinal.github.io/html-only/layouts/index.html
T

61 lines
1.7 KiB
HTML

{{ define "head" }}
<link rel="stylesheet" href='{{ "css/index.css" | absURL }}'>
{{ end }}
{{ define "main" }}
<main id="main" class="index">
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "==" "post") }}
{{ range $paginator.Pages }}
<div class="post">
<h2>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<div>
{{ if .Site.Params.showWordCount }}
<span>{{ .WordCount }} words</span>
{{ end }}
{{ if gt .ReadingTime 1 }}
{{ .Scratch.Set "timeUnit" "mins" }}
{{ else }}
{{ .Scratch.Set "timeUnit" "min" }}
{{ end }}
{{ if .Site.Params.showReadingTime }}
<span>~{{.ReadingTime}} {{ .Scratch.Get "timeUnit" }}</span>
{{ end }}
<time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time>
</div>
</h2>
{{ if ne .Params.tags nil }}
<div>
{{ range .Params.tags }}
<a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
{{ end }}
</div>
{{ end }}
<div class="content">
{{ if .Site.Params.emphasisWithDots }}
{{ .Summary | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
{{ else }}
{{ .Summary }}
{{ end }}
</div>
</div>
{{ end }}
{{ if or $paginator.HasPrev $paginator.HasNext}}
<div class="paginator">
{{ if $paginator.HasPrev }}
<a class="link" href="{{ $paginator.Prev.URL }}">← prev</a>
{{ else }}
<a></a>
{{ end }}
{{ if $paginator.HasNext }}
<a class="link" href="{{ $paginator.Next.URL }}">next →</a>
{{ else }}
<a></a>
{{ end }}
</div>
{{ end }}
</main>
{{ end }}