aboutsummaryrefslogtreecommitdiffstats
path: root/code/frontpage/layouts/_default
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2023-02-25 13:15:44 +0100
committerivarlovlie <git@ivarlovlie.no>2023-02-25 13:15:44 +0100
commit900bb5e845c3ad44defbd427cae3d44a4a43321f (patch)
treedf3d96a93771884add571e82336c29fc3d9c7a1c /code/frontpage/layouts/_default
downloadgreatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.tar.xz
greatoffice-900bb5e845c3ad44defbd427cae3d44a4a43321f.zip
feat: Initial commit
Diffstat (limited to 'code/frontpage/layouts/_default')
-rw-r--r--code/frontpage/layouts/_default/_markup/render-heading.html1
-rw-r--r--code/frontpage/layouts/_default/baseof.html32
-rw-r--r--code/frontpage/layouts/_default/index.js10
-rw-r--r--code/frontpage/layouts/_default/index.json5
-rw-r--r--code/frontpage/layouts/_default/list.html31
-rw-r--r--code/frontpage/layouts/_default/section.sitemap.xml46
-rw-r--r--code/frontpage/layouts/_default/single.html10
-rw-r--r--code/frontpage/layouts/_default/terms.html20
-rw-r--r--code/frontpage/layouts/_default/versions.html27
9 files changed, 182 insertions, 0 deletions
diff --git a/code/frontpage/layouts/_default/_markup/render-heading.html b/code/frontpage/layouts/_default/_markup/render-heading.html
new file mode 100644
index 0000000..8abeac6
--- /dev/null
+++ b/code/frontpage/layouts/_default/_markup/render-heading.html
@@ -0,0 +1 @@
+<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}" class="anchor" aria-hidden="true">#</a></h{{ .Level }}>
diff --git a/code/frontpage/layouts/_default/baseof.html b/code/frontpage/layouts/_default/baseof.html
new file mode 100644
index 0000000..155ff84
--- /dev/null
+++ b/code/frontpage/layouts/_default/baseof.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html lang="{{ .Site.Params.languageTag | default "en-US" }}">
+ {{ partial "head/head.html" . }}
+ {{ if eq .Kind "home" -}}
+ {{ .Scratch.Set "class" "home" -}}
+ {{ else if eq .Kind "404" -}}
+ {{ .Scratch.Set "class" "error404" -}}
+ {{ else if eq .Kind "page" -}}
+ {{ .Scratch.Set "class" .Type -}}
+ {{ .Scratch.Add "class" " single" -}}
+ {{ else -}}
+ {{ .Scratch.Set "class" .Type -}}
+ {{ .Scratch.Add "class" " list" -}}
+ {{ end -}}
+ <body class="{{ .Scratch.Get "class" }}"{{ if eq .Site.Params.options.scrollSpy true }} data-bs-spy="scroll" data-bs-target="#toc" data-bs-root-margin="0px 0px -90%" data-bs-smooth-scroll="true" tabindex="0"{{ end }}>
+ {{ partial "header/header.html" . }}
+ <div class="wrap container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}" role="document">
+ <div class="content">
+ {{ block "main" . }}{{ end }}
+ </div>
+ </div>
+ {{ block "sidebar-prefooter" . }}{{ end }}
+ {{ block "sidebar-footer" . }}{{ end }}
+ {{ partial "footer/footer.html" . }}
+ {{ partial "footer/script-footer.html" . }}
+ {{ if eq .Site.Params.options.toTopButton true -}}
+ <div class="d-flex fixed-bottom pb-4 pb-lg-5 pe-4 pe-lg-5">
+ <a id="toTop" href="#" class="btn btn-outline-primary rounded-circle ms-auto p-2"><span class="visually-hidden">Top</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up"><polyline points="18 15 12 9 6 15"></polyline></svg></a>
+ </div>
+ {{ end }}
+ </body>
+</html> \ No newline at end of file
diff --git a/code/frontpage/layouts/_default/index.js b/code/frontpage/layouts/_default/index.js
new file mode 100644
index 0000000..9f764f9
--- /dev/null
+++ b/code/frontpage/layouts/_default/index.js
@@ -0,0 +1,10 @@
+var docs = [
+{{ range $index, $page := (where .Site.Pages "Section" "docs") -}}
+ {
+ id: {{ $index }},
+ title: "{{ .Title }}",
+ description: "{{ .Params.description }}",
+ href: "{{ .URL | relURL }}"
+ },
+{{ end -}}
+]; \ No newline at end of file
diff --git a/code/frontpage/layouts/_default/index.json b/code/frontpage/layouts/_default/index.json
new file mode 100644
index 0000000..6842871
--- /dev/null
+++ b/code/frontpage/layouts/_default/index.json
@@ -0,0 +1,5 @@
+{{- $.Scratch.Add "index" slice -}}
+{{- range .Site.RegularPages -}}
+ {{- $.Scratch.Add "index" (dict "title" .Title "description" .Params.description "contents" .Plain "RelPermalink" .RelPermalink) -}}
+{{- end -}}
+{{- $.Scratch.Get "index" | jsonify -}} \ No newline at end of file
diff --git a/code/frontpage/layouts/_default/list.html b/code/frontpage/layouts/_default/list.html
new file mode 100644
index 0000000..455b2af
--- /dev/null
+++ b/code/frontpage/layouts/_default/list.html
@@ -0,0 +1,31 @@
+{{ define "main" }}
+<div class="row justify-content-center">
+ <div class="col-md-12 col-lg-9">
+ <h1 class="text-center">{{ .Title }}</h1>
+ {{ with .Content -}}<div class="text-center">{{ . }}</div>{{ end -}}
+ </div>
+</div>
+<div class="row row-cols-1 row-cols-lg-2 g-lg-5">
+ {{ $paginator := .Paginate (.Data.Pages) -}}
+ {{ range $paginator.Pages -}}
+ <div class="col">
+ <div class="card">
+ {{- .Scratch.Set "fillImage" "1270x620 Center" -}}
+ <div class="card-body">
+ <article>
+ <h2 class="h3"><a class="stretched-link text-body" href="{{ .RelPermalink }}">{{ .Params.title }}</a></h2>
+ <p>{{ .Params.excerpt | safeHTML }}</p>
+ {{ partial "main/blog-meta.html" . -}}
+ </article>
+ </div>
+ </div>
+ </div>
+ {{ end -}}
+</div>
+<div class="row justify-content-center">
+ <div class="col-md-12 col-lg-9">
+ {{ $.Scratch.Set "paginator" true }}
+ {{ template "_internal/pagination.html" . }}
+ </div>
+</div>
+{{ end }} \ No newline at end of file
diff --git a/code/frontpage/layouts/_default/section.sitemap.xml b/code/frontpage/layouts/_default/section.sitemap.xml
new file mode 100644
index 0000000..701951d
--- /dev/null
+++ b/code/frontpage/layouts/_default/section.sitemap.xml
@@ -0,0 +1,46 @@
+{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML -}}
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ {{ range $i, $e := .Data.Pages -}}
+ {{ if ne .Params.sitemap_exclude true }}
+ <url>
+ <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
+ <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
+ <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
+ <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ </url>
+ {{ end -}}
+ {{ end -}}
+ {{ range .Sections -}}
+ {{ range $i, $e := .Data.Pages -}}
+ {{ if ne .Params.sitemap_exclude true -}}
+ <url>
+ <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
+ <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
+ <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
+ <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ <xhtml:link
+ rel="alternate"
+ hreflang="{{ .Lang }}"
+ href="{{ .Permalink }}"
+ />{{ end }}
+ </url>
+ {{ end -}}
+ {{ end -}}
+ {{ end -}}
+</urlset> \ No newline at end of file
diff --git a/code/frontpage/layouts/_default/single.html b/code/frontpage/layouts/_default/single.html
new file mode 100644
index 0000000..2f8fc99
--- /dev/null
+++ b/code/frontpage/layouts/_default/single.html
@@ -0,0 +1,10 @@
+{{ define "main" }}
+<div class="row justify-content-center">
+ <div class="col-md-12 col-lg-10 col-xl-8">
+ <article>
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+ </article>
+ </div>
+</div>
+{{ end }}
diff --git a/code/frontpage/layouts/_default/terms.html b/code/frontpage/layouts/_default/terms.html
new file mode 100644
index 0000000..73fdeb8
--- /dev/null
+++ b/code/frontpage/layouts/_default/terms.html
@@ -0,0 +1,20 @@
+{{ define "main" }}
+<div class="row justify-content-center">
+ <div class="col-md-12 col-lg-10 col-xl-8">
+ <h1 class="text-center">{{ .Title }}</h1>
+ <div class="text-center">{{ .Content }}</div>
+ <div class="card-list">
+ {{ range .Paginator.Pages }}
+ <div class="card card-terms my-3">
+ <div class="card-body">
+ <article>
+ <a class="stretched-link" href="{{ .RelPermalink }}">{{ .Params.title | title }} &rarr;</a>
+ </article>
+ </div>
+ </div>
+ {{ end }}
+ </div>
+ {{ template "_internal/pagination.html" . }}
+ </div>
+</div>
+{{ end }}
diff --git a/code/frontpage/layouts/_default/versions.html b/code/frontpage/layouts/_default/versions.html
new file mode 100644
index 0000000..3101b82
--- /dev/null
+++ b/code/frontpage/layouts/_default/versions.html
@@ -0,0 +1,27 @@
+{{ define "main" }}
+ <article>
+ <h1>{{ .Title }}</h1>
+ <p class="lead">{{ .Params.lead | safeHTML }}</p>
+ {{ .Content }}
+ <div class="row">
+ {{ range $release := sort (index $.Site.Data "docs-versions") "group" "desc" -}}
+ <div class="col-md-8 col-lg-4 col-xl mb-4">
+ <h2>{{ $release.group }}</h2>
+ <p>{{ $release.description }}</p>
+ {{ $versions := sort $release.versions "v" "desc" -}}
+ {{ range $i, $version := $versions -}}
+ {{ $len := len $versions -}}
+ {{ if (eq $i 0) }}<div class="list-group">{{ end }}
+ <a class="list-group-item list-group-item-action py-2 text-primary{{ if (eq $version.v $.Site.Params.docsVersion) }} d-flex justify-content-between align-items-center{{ end }}" href="{{ $release.baseurl }}/{{ $version.v }}/">
+ {{ $version.v }}
+ {{ if (eq $version.v $.Site.Params.docsVersion) -}}
+ <span class="badge bg-primary">Latest</span>
+ {{ end -}}
+ </a>
+ {{ if (eq (add $i 1) $len) }}</div>{{ end }}
+ {{ end -}}
+ </div>
+ {{ end -}}
+ </div>
+ </article>
+{{ end }}