summaryrefslogtreecommitdiff
path: root/site/themes/sine/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'site/themes/sine/layouts')
-rw-r--r--site/themes/sine/layouts/404.html5
-rw-r--r--site/themes/sine/layouts/_default/baseof.html30
-rw-r--r--site/themes/sine/layouts/_default/list.html16
-rw-r--r--site/themes/sine/layouts/_default/single.html7
-rw-r--r--site/themes/sine/layouts/index.html4
-rw-r--r--site/themes/sine/layouts/partials/footer.html1
-rw-r--r--site/themes/sine/layouts/partials/head.html36
-rw-r--r--site/themes/sine/layouts/partials/header.html0
-rw-r--r--site/themes/sine/layouts/partials/nav.html15
9 files changed, 114 insertions, 0 deletions
diff --git a/site/themes/sine/layouts/404.html b/site/themes/sine/layouts/404.html
new file mode 100644
index 0000000..12883f1
--- /dev/null
+++ b/site/themes/sine/layouts/404.html
@@ -0,0 +1,5 @@
+{{ define "main" }}
+<h1>Page Not Found</h1>
+
+<p>Sorry, this page doesn't exist.</p>
+{{ end }}
diff --git a/site/themes/sine/layouts/_default/baseof.html b/site/themes/sine/layouts/_default/baseof.html
new file mode 100644
index 0000000..89f10a8
--- /dev/null
+++ b/site/themes/sine/layouts/_default/baseof.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html data-theme="dark">
+ <head>
+ {{- partial "head.html" . -}}
+ </head>
+ <body>
+
+ <canvas id="background"></canvas>
+
+ <div id="main">
+ {{- partial "nav.html" . -}}
+ <div id="content">
+ {{- block "main" . }}{{- end }}
+ <footer>
+ {{- partial "footer.html" . -}}
+ </footer>
+ </div>
+ </div>
+
+ <!-- Background -->
+ <script id="background-config" type="application/json">
+ {{ site.Params.background | jsonify | safeJS }}
+ </script>
+ <script src="{{ "/js/background.js" | relURL }}"></script>
+
+ <!-- Theme Switcher -->
+ <script src="{{ "/js/switch-theme.js" | relURL }}"></script>
+
+ <body>
+</html>
diff --git a/site/themes/sine/layouts/_default/list.html b/site/themes/sine/layouts/_default/list.html
new file mode 100644
index 0000000..c51e7d6
--- /dev/null
+++ b/site/themes/sine/layouts/_default/list.html
@@ -0,0 +1,16 @@
+{{ define "main" }}
+<h1>{{ .Title }}</h1>
+
+{{- .Content -}}
+
+{{ range.Data.Pages }}
+<article class="post-snippet">
+ <h3>
+ <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+ </h3>
+ <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
+ {{ .Date.Format "January 2, 2006" }}
+ </time>
+</article>
+{{ end }}
+{{ end }}
diff --git a/site/themes/sine/layouts/_default/single.html b/site/themes/sine/layouts/_default/single.html
new file mode 100644
index 0000000..3ba2777
--- /dev/null
+++ b/site/themes/sine/layouts/_default/single.html
@@ -0,0 +1,7 @@
+{{ define "main" }}
+
+<h1>{{ .Title }}</h1>
+
+{{- .Content -}}
+
+{{ end }}
diff --git a/site/themes/sine/layouts/index.html b/site/themes/sine/layouts/index.html
new file mode 100644
index 0000000..2acde8d
--- /dev/null
+++ b/site/themes/sine/layouts/index.html
@@ -0,0 +1,4 @@
+{{ define "main" }}
+ {{- .Content -}}
+ <p>{{ .Site.Params.description }}</p>
+{{ end }}
diff --git a/site/themes/sine/layouts/partials/footer.html b/site/themes/sine/layouts/partials/footer.html
new file mode 100644
index 0000000..24373ca
--- /dev/null
+++ b/site/themes/sine/layouts/partials/footer.html
@@ -0,0 +1 @@
+<p>&copy;{{ dateFormat "2006" now }} {{ .Site.Title }}</p>
diff --git a/site/themes/sine/layouts/partials/head.html b/site/themes/sine/layouts/partials/head.html
new file mode 100644
index 0000000..e7c23e5
--- /dev/null
+++ b/site/themes/sine/layouts/partials/head.html
@@ -0,0 +1,36 @@
+<meta charset="UTF-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
+<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
+
+<!-- Scuffed fix for theme change flash -->
+<script>
+ // Run as early as possible
+ (function() {
+ const theme = localStorage.getItem("theme");
+ const preloadClass = theme === "dark" ? "preload-dark" : "preload-light";
+
+ // Add preload class to <html>
+ document.documentElement.classList.add(preloadClass);
+
+ // Wait for stylesheet(s) to load, then remove class
+ window.addEventListener("load", function() {
+ document.documentElement.classList.remove(preloadClass);
+ });
+ })();
+</script>
+<style>
+ /* Temporary background colors before stylesheet is fully loaded */
+ .preload-light * {
+ background: #ffffff !important;
+ }
+ .preload-dark * {
+ background: #161616 !important;
+ }
+</style>
+
+<link rel="stylesheet" href="/css/style.css" type="text/css" media="all" />
+
+{{ with .OutputFormats.Get "rss" -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{ end -}}
diff --git a/site/themes/sine/layouts/partials/header.html b/site/themes/sine/layouts/partials/header.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/site/themes/sine/layouts/partials/header.html
diff --git a/site/themes/sine/layouts/partials/nav.html b/site/themes/sine/layouts/partials/nav.html
new file mode 100644
index 0000000..efd7e5b
--- /dev/null
+++ b/site/themes/sine/layouts/partials/nav.html
@@ -0,0 +1,15 @@
+<header class="site-header">
+ <nav class="navbar">
+ <div id="logoContainer">
+ <a class="logo" href="{{ .Site.BaseURL }}">{{- .Site.Title -}}</a>
+ <button type="button" id="toggleTheme" data-theme-toggle aria-label="switch theme"></button>
+ </div>
+ <ul class="nav-links">
+ {{ range.Site.Menus.main }}
+ <li>
+ <a href="{{ .URL }}">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </nav>
+</header>