Copying layouts from old theme to new

This commit is contained in:
2020-05-31 05:21:00 +01:00
parent 3503ec15d8
commit 9dbf2d80d7
28 changed files with 882 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
{{ partial "head.html" . }}
{{ partial "css.html" . }}
{{ partial "schema.html" . }}
</head>
<body>
{{ partial "header.html" . }}
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
{{ partial "foot.html" . }}
{{ template "_internal/google_analytics.html" . }}
{{ partial "js.html" . }}
</body>
</html>

View File

@@ -0,0 +1,21 @@
<div class="card h-100" data-aos="zoom-in">
{{ $page := . }}
<a href="{{ $page.RelPermalink }}" class="d-block">
{{- with $page.Params.images -}}
{{- $images := . -}}
{{- with $page.Site.GetPage "section" "images" -}}
{{- with .Resources.GetMatch (strings.TrimPrefix "/images/" (index $images 0)) -}}
{{- $image := . -}}
<img data-src="{{ $image.RelPermalink }}" class="card-img-top mx-auto d-block pt-2" alt="{{ $page.Title }}">
{{- end -}}
{{- end -}}
{{- end -}}
<div class="card-body">
<h4 class="card-title">{{ $page.Title }}</h4>
<p class="card-text text-muted text-uppercase">{{ $page.Date.Format "January 2, 2006" }}</p>
<div class="card-text">
{{ $page.Summary | plainify }}
</div>
</div>
</a>
</div>

View File

@@ -0,0 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "subtitle" .Params.subtitle "description" .Params.description "tags" .Params.tags "images" .Params.images "content" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View File

@@ -0,0 +1,24 @@
{{ define "main" }}
<main class="list container py-6">
{{- if or .Title .Content -}}
<div class="row py-3">
<div class="col">
{{ with .Title }}<h3 class="display-4">{{ . }}</h3>{{ end }}
{{- with .Content -}}
<div class="content">
{{ . }}
</div>
{{- end -}}
</div>
</div>
{{- end -}}
<div class="row row-cols-1 row-cols-lg-3">
{{ range .Pages }}
<div class="col mb-3">
{{ .Render "card" }}
</div>
{{ end }}
</div>
</main>
{{ end }}

View File

@@ -0,0 +1,19 @@
{{ define "main" }}
{{ .Scratch.Set "IsSingle" true }}
<main class="content-page container pt-7 pb-5">
<div class="row">
<div class="col">
<article>
<div class="row justify-content-center">
<div class="col-lg-8">
<h2 class="mb-3">{{ .Title }}</h2>
<div class="content">
{{ .Content }}
</div>
</div>
</div>
</article>
</div>
</div>
</main>
{{ end }}