Tweak theme

This commit is contained in:
Dave Gallant
2024-04-07 21:46:55 -04:00
parent 2475d2d67e
commit 8d898eb69a
117 changed files with 5 additions and 9 deletions

View File

@@ -0,0 +1,4 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
{{- .Text | safeHTML -}}
<a href="#{{ .Anchor | safeURL }}" class="post-heading__anchor" aria-hidden="true">#</a>
</h{{ .Level }}>

View File

@@ -0,0 +1,13 @@
{{- $isExternal := strings.HasPrefix .Destination "http" -}}
<a
href="{{ .Destination | safeURL }}"
{{ with .Title }}
title="{{ . }}"
{{ end }}
{{ if $isExternal }}
class="link--external" target="_blank" rel="noreferrer"
{{ end }}
>
{{- .Text | safeHTML -}}
</a>
{{- /* Trimm trailing whitespace */ -}}

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html
lang="{{ .Site.Language.Lang | default "en" }}"
data-theme="{{ .Param "defaultTheme" | default "light" }}"
>
{{ partial "head/head.html" . }}
<body>
<div class="layout">
{{ partial "header.html" . }}
<main>
<div class="content">
{{ block "main" . }}{{ end }}
</div>
{{ partial "sidebar.html" . }}
</main>
{{ partial "footer.html" . }}
</div>
</body>
</html>

View File

@@ -0,0 +1,9 @@
{{ define "main" }}
<div class="content-section">
<h1>{{ .Title | markdownify }}</h1>
{{ with .Content }}
<div>{{ . }}</div>
{{ end }}
</div>
{{ partial "post-list.html" .Paginator }}
{{ end }}

View File

@@ -0,0 +1,20 @@
{{ define "main" }}
<article class="post">
<div class="post-header">
<h1>{{ .Title | markdownify }}</h1>
{{ partial "post-meta.html" (dict "page" . "pageIndex" 0) }}
</div>
<div class="post-content">
{{ .Content }}
</div>
{{ if .Params.SocialShare }}
{{ partial "social-share.html" . }}
{{ end }}
{{ if .Params.Comments }}
{{ partial "comments.html" . }}
{{ end }}
</article>
{{ end }}