first commit
This commit is contained in:
0
layouts/404.html
Normal file
0
layouts/404.html
Normal file
66
layouts/_default/baseof.html
Normal file
66
layouts/_default/baseof.html
Normal file
@@ -0,0 +1,66 @@
|
||||
{{ $themeStyleDefault := "light.css" -}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
{{- if isset .Site.Params "onionlocation" }}
|
||||
<meta http-equiv="onion-location" content="{{ urls.JoinPath .Site.Params.OnionLocation .RelPermalink }}">
|
||||
{{- end }}
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link rel="stylesheet" href="{{ "css/styles.css" | relURL }}">
|
||||
<link id="theme_css" rel="stylesheet" href="{{ "css/themes" | relURL }}/{{ .Site.Params.ThemeStyle | default $themeStyleDefault }}">
|
||||
{{- if .Site.Params.ThemeStyleSwitcher }}
|
||||
<script src="{{ "js/theme-switcher.js" | relURL }}"></script>
|
||||
{{- end }}
|
||||
</head>
|
||||
<body>
|
||||
<input class="show-hide-menu-input" style="display:none;" autocomplete="off" type="checkbox" id="toggle-1">
|
||||
<label class="overlay" for="toggle-1"></label>
|
||||
<div class="main">
|
||||
<header class="header">
|
||||
<div class="header-content">
|
||||
<div class="title">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
<div>
|
||||
<div class="header-right">
|
||||
{{- if .Site.Params.ThemeStyleSwitcher }}
|
||||
<div id="change-theme-button" style="display:none;" class="clickable-header-label" onclick="toggle_theme()">
|
||||
<img class="color-adapting-image" width="30" src="" alt="change theme button">
|
||||
</div>
|
||||
{{- end }}
|
||||
<label id="show-hide-menu-label" class="clickable-header-label" for="toggle-1">
|
||||
<img class="color-adapting-image" width="30" src="{{ "images/hamburger.svg" | relURL }}" alt="menu button">
|
||||
</label>
|
||||
</div>
|
||||
{{- if .Site.Menus.main }}
|
||||
<div class="dont-show">
|
||||
<p>
|
||||
Links:
|
||||
</p>
|
||||
</div>
|
||||
<ul class="links">
|
||||
{{- range .Site.Menus.main.ByWeight }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="body">
|
||||
<div class="body-content">
|
||||
{{- block "main" . }}{{ end }}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
{{- if .Site.Params.FooterText }}
|
||||
<hr class="dont-show">
|
||||
<footer class="footer">
|
||||
<p>{{ .Site.Params.FooterText | markdownify }}</p>
|
||||
</footer>
|
||||
{{- end }}
|
||||
</body>
|
||||
</html>
|
||||
45
layouts/_default/list.html
Normal file
45
layouts/_default/list.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{{ define "title" }}{{ .Title }} – {{ .Site.Title }}{{ end }}
|
||||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
<div class="title-header">
|
||||
<h1>{{ .Title }}</h1>
|
||||
</div>
|
||||
{{- if gt (len .Sections) 0 }}
|
||||
<h2>Categories</h2>
|
||||
<ul class="section-list">
|
||||
{{- range .Sections }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
<h2>All Posts</h2>
|
||||
{{- end }}
|
||||
{{- $cs := .CurrentSection }}
|
||||
{{- with $cs }}
|
||||
{{- range (where .Site.RegularPages "Section" .Section) }}
|
||||
{{- if .IsDescendant $cs }}
|
||||
<article class="all-list">
|
||||
<div class="title-list">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
|
||||
<div class="title-list-date">
|
||||
{{- if eq .Date.IsZero false }}
|
||||
<time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
{{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
(updated)
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="body-list">
|
||||
<p></p> {{/* Spacing is weird if we don't include this */}}
|
||||
<p>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
{{- if .Truncated }}
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
33
layouts/_default/single.html
Normal file
33
layouts/_default/single.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{{ define "title" }}{{ .Title }} – {{ .Site.Title }}{{ end }}
|
||||
{{ define "main" }}
|
||||
<header class="title-header">
|
||||
<h1>{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</h1>
|
||||
<div class="title-header-date">
|
||||
{{- if eq .Date.IsZero false }}
|
||||
<time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
{{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
— last updated <time>{{ .Lastmod.Format "January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ if or (.Params.toc) (and (ne .Params.toc false) (isset .Site.Params "tocwordthreshold") (ge .Site.Params.TocWordThreshold 0) (gt .WordCount .Site.Params.TocWordThreshold)) }}
|
||||
{{/* If the front matter parameter is true, show the toc */}}
|
||||
{{/* Elif the front matter parameter is false, don't show the toc */}}
|
||||
{{/* Elif the front matter parameter is not set, show the toc if the site parameter is set, non-negative, and less than the word count */}}
|
||||
<p></p>
|
||||
<div class="table-of-contents">
|
||||
<details open="open">
|
||||
<summary>
|
||||
<span class="table-of-contents-title">Table of Contents</span>
|
||||
</summary>
|
||||
{{ $toc := .TableOfContents -}}
|
||||
{{/* Workaround for an extra layer of indentation (https://discourse.gohugo.io/t/2303) */}}
|
||||
{{- $toc := replaceRE `<nav(.*)>(\s*)<ul>\s*<li>\s*<ul>` `<nav${1}>${2}<ul>` $toc -}}
|
||||
{{- $toc := replaceRE `</ul>\s*</li>\s*</ul>(\s*)</nav>` `</ul>${1}</nav>` $toc -}}
|
||||
{{- safeHTML $toc }}
|
||||
</details>
|
||||
</div>
|
||||
{{ end }}
|
||||
</header>
|
||||
{{ .Content | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" (printf "${1}<aside class=\"heading-anchor\"><a href=\"#${2}\" aria-label=\"Anchor\"><img src=\"%s\" class=\"color-adapting-image\" height=\"20\"></a></aside>${3}" ("images/chain-link.svg" | relURL)) | safeHTML }}
|
||||
{{ end }}
|
||||
45
layouts/index.html
Normal file
45
layouts/index.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{{ define "title" }}{{ .Title }} – {{ .Site.Title }}{{ end }}
|
||||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
<div class="title-header">
|
||||
<h1>{{ .Title }}</h1>
|
||||
</div>
|
||||
{{- if gt (len .Sections) 0 }}
|
||||
<h2>Categories</h2>
|
||||
<ul class="section-list">
|
||||
{{- range .Sections }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
<h2>All Posts</h2>
|
||||
{{- end }}
|
||||
{{- $cs := .CurrentSection }}
|
||||
{{- with $cs }}
|
||||
{{- range (where .Site.RegularPages "Section" .Section) }}
|
||||
{{- if .IsDescendant $cs }}
|
||||
<article class="all-list">
|
||||
<div class="title-list">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
|
||||
<div class="title-list-date">
|
||||
{{- if eq .Date.IsZero false }}
|
||||
<time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
{{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
(updated)
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="body-list">
|
||||
<p></p> {{/* Spacing is weird if we don't include this */}}
|
||||
<p>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
{{- if .Truncated }}
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
11
layouts/shortcodes/notice.html
Normal file
11
layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- .Scratch.Set "type" "note" -}}
|
||||
{{- with .Get 0 }}{{ $.Scratch.Set "type" . }}{{ end -}}
|
||||
<aside class="notice {{ .Scratch.Get "type" }}">
|
||||
<hr>
|
||||
<div class="notice-title">
|
||||
<img class="notice-title-icon" src="{{ "images/exclamation.svg" | relURL }}" height="15">
|
||||
<span>{{ with .Get 1 }}{{ . }}{{ else }}{{ .Scratch.Get "type" | humanize }}{{ end }}</span>
|
||||
</div>
|
||||
<div class="notice-body">{{ .Inner | markdownify }}</div>
|
||||
<hr>
|
||||
</aside>
|
||||
Reference in New Issue
Block a user