fix it
This commit is contained in:
7
homepage/layouts/_default/_markup/render-heading.html
Normal file
7
homepage/layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ $class := "" }}
|
||||
{{ if findRE "^(?:\\d+\\.)+\\s+" .Text 1 }}
|
||||
{{ $class = "manual-number" }}
|
||||
{{ end }}
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}"{{ with $class }} class="{{ . }}"{{ end }}>
|
||||
{{ .Text | safeHTML }}
|
||||
</h{{ .Level }}>
|
||||
20
homepage/layouts/_default/_markup/render-image.html
Normal file
20
homepage/layouts/_default/_markup/render-image.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{- $alt := .Text -}} {{- $src := .Destination -}} {{- $title := .Title -}}
|
||||
|
||||
<figure>
|
||||
<img
|
||||
src="{{ $src }}"
|
||||
alt="{{ $alt }}"
|
||||
loading="lazy"
|
||||
{{
|
||||
with
|
||||
$title
|
||||
}}
|
||||
title="{{ . }}"
|
||||
{{
|
||||
end
|
||||
}}
|
||||
/>
|
||||
{{- with $alt }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end -}}
|
||||
</figure>
|
||||
30
homepage/layouts/_default/archive.html
Normal file
30
homepage/layouts/_default/archive.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{{ define "main" }}
|
||||
<h1>Archive</h1>
|
||||
<div class="archive">
|
||||
{{- $.Scratch.Add "year" "" -}}
|
||||
{{- $.Scratch.Add "month" "" -}}
|
||||
|
||||
{{- range where site.Pages "Section" "posts" -}}
|
||||
{{- if and (not .Draft) .Date -}}
|
||||
{{- $year := .Date.Format "2006" -}}
|
||||
{{- $month := .Date.Format "January" -}}
|
||||
|
||||
{{- if ne $year ($.Scratch.Get "year") -}}
|
||||
{{- $.Scratch.Set "year" $year -}}
|
||||
{{- $.Scratch.Set "month" "" -}}
|
||||
<h2 class="archive-year">{{ $year }}</h2>
|
||||
{{- end -}}
|
||||
|
||||
{{- if ne $month ($.Scratch.Get "month") -}}
|
||||
{{- $.Scratch.Set "month" $month -}}
|
||||
<h3 class="archive-month">{{ $month }}</h3>
|
||||
{{- end -}}
|
||||
|
||||
<article class="archive-item">
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02" }}</time>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</article>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
15
homepage/layouts/_default/baseof.html
Normal file
15
homepage/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
lang="{{ site.Language.Locale }}"
|
||||
dir="{{ or site.Language.Direction `ltr` }}"
|
||||
>
|
||||
<head>
|
||||
{{ partial "head.html" . }}
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Skip to content</a>
|
||||
<header role="banner">{{ partial "header.html" . }}</header>
|
||||
<main id="main-content" role="main">{{ block "main" . }}{{ end }}</main>
|
||||
<footer role="contentinfo">{{ partial "footer.html" . }}</footer>
|
||||
</body>
|
||||
</html>
|
||||
14
homepage/layouts/_default/list.html
Normal file
14
homepage/layouts/_default/list.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
<div class="time-list">
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<span>{{- partial "date" .Date -}}</span>
|
||||
<div><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
51
homepage/layouts/_default/single.html
Normal file
51
homepage/layouts/_default/single.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
|
||||
|
||||
{{/* Table of Contents */}}
|
||||
{{ $hasToC := .Params.toc | default true }}
|
||||
{{ $headers := findRE "<h[2-6]" .Content }}
|
||||
{{ if and $hasToC (ge (len $headers) 1) }}
|
||||
<details class="toc" open>
|
||||
<summary class="toc-title">Table of contents</summary>
|
||||
<nav class="toc-content">
|
||||
{{ .TableOfContents }}
|
||||
</nav>
|
||||
</details>
|
||||
{{ end }}
|
||||
|
||||
<!-- Content -->
|
||||
{{ .Content }}
|
||||
<div class="time">
|
||||
{{ partial "date.html" .Date }}
|
||||
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
|
||||
{{ if and $showReadingTime .ReadingTime }}
|
||||
<span class="reading-time"> · {{ .ReadingTime }} min read</span>
|
||||
{{ end }}
|
||||
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
|
||||
{{ if and $showLastMod .Lastmod }}
|
||||
{{ if ne .LastMod.Format "2006-01-02" .Date.Format "2006-01-02" }}
|
||||
<span class="lastmod"> · Last updated: {{ .LastMod.Format "2006-01-02" }}</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- Comments block -->
|
||||
{{ if and .Content (default true (default .Site.Params.comments
|
||||
.Params.comments))
|
||||
}}
|
||||
<div class="comments">{{- partial "comments" . -}}</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if not .IsHome }}
|
||||
<div class="terminal-nav">
|
||||
<div class="back-nav">
|
||||
{{ with .Parent }}
|
||||
<a href="{{ .RelPermalink }}" class="back-link">../</a>
|
||||
{{ else }}
|
||||
<a href="{{ "/" | relURL }}" class="back-link">../</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user