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/blog/layouts/partials/header.html
T
avinal a196ac4391 added hugo website
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
2024-03-30 12:44:19 +05:30

25 lines
1008 B
HTML

<header class="relative">
<img class="object-cover w-full h-60 sm:h-96 brightness-50" src="{{ .Params.Image | absURL }}" alt="{{ .Title }}">
<h1 class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center w-full text-white">{{ .Title }}</h1>
<span class="absolute bottom-1/4 left-1/2 -translate-x-1/2 text-base font-sans oldstyle-nums text-center w-full">
<a class="font-bold no-underline hover:text-pink-500" href="/">Avinal Kumar</a>
|
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format ":date_long" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{ 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 }}
</span>
</header>