aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html7
-rw-r--r--layouts/_default/baseof.html4
-rw-r--r--layouts/_default/list.html23
-rw-r--r--layouts/_default/single.html13
-rw-r--r--layouts/_default/summary.html24
-rw-r--r--layouts/book/list.html31
-rw-r--r--layouts/book/single.html40
-rw-r--r--layouts/book/summary.html29
-rw-r--r--layouts/index.html10
-rw-r--r--layouts/partials/disclaimer.html2
-rw-r--r--layouts/partials/footer.html32
-rw-r--r--layouts/partials/func/GetSvg.html5
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/header.html14
-rw-r--r--layouts/partials/scripts.html5
-rw-r--r--layouts/partials/site-actions.html18
-rw-r--r--layouts/partials/social.html16
-rw-r--r--layouts/partials/updated_posts.html17
-rw-r--r--layouts/post/single.html19
-rw-r--r--layouts/robots.txt11
-rw-r--r--layouts/shortcodes/projects.html12
21 files changed, 288 insertions, 46 deletions
diff --git a/layouts/404.html b/layouts/404.html
index e69de29..1a739ff 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -0,0 +1,7 @@
1{{ define "main" }}
2 <main id="main">
3 <div>
4 <h1 id="title"><a href="{{ "" | relURL }}">Go Home</a></h1>
5 </div>
6 </main>
7{{ end }} \ No newline at end of file
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 6ed81b9..acb6c6a 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,7 +1,8 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<html lang="en" data-theme="dark"> 2<html lang="en" data-theme="light">
3 {{- partial "head.html" . -}} 3 {{- partial "head.html" . -}}
4 <body> 4 <body>
5 {{- partial "site-actions" . -}}
5 {{- partial "header.html" . -}} 6 {{- partial "header.html" . -}}
6 <div 7 <div
7 class='container' 8 class='container'
@@ -11,5 +12,6 @@
11 {{- end }} 12 {{- end }}
12 </div> 13 </div>
13 {{- partial "footer.html" . -}} 14 {{- partial "footer.html" . -}}
15 {{- partial "scripts.html" . -}}
14 </body> 16 </body>
15</html> 17</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 5d1370f..7a26339 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,12 +1,11 @@
1{{ define "main" }} 1{{ define "main" }}
2 <article> 2 <h1>{{ .Title | title }}</h1>
3 <section>{{- .Content -}}</section> 3 {{ if .Content }}
4 <section> 4 <p>{{ .Content }}</p>
5 {{ range .Paginator.Pages }} 5 {{ end }}
6 <div> 6 <section>
7 {{ .Render "summary" }} 7 {{ range sort .Pages "Date" "desc" }}
8 </div> 8 <div>{{ .Render "summary" }}</div>
9 {{ end }} 9 {{ end }}
10 </section> 10 </section>
11 </article> 11{{ end }}
12{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 3e48693..49137fb 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,4 +1,9 @@
1{{ define "main" }} 1{{ define "main" }}
2 <h1>{{ .Title }}</h1> 2 <hgroup>
3 {{- .Content -}} 3 <h1>{{- .Title -}}</h1>
4{{ end }} \ No newline at end of file 4 <p>Some dude on the internet with—like—opinions and stuff</p>
5 </hgroup>
6 <section class="content">
7 {{- .Content -}}
8 </section>
9{{ end }}
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index afd5f2b..48c7b97 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -1,13 +1,17 @@
1<div> 1<section>
2 <div> 2 <hgroup>
3 {{with .CurrentSection.Title }}<span class="f6 db">{{ . }}</span>{{end}} 3 <h3 class="f3 near-black">
4 <h1 class="f3 near-black">
5 <a href="{{ .RelPermalink }}" class="link black dim"> 4 <a href="{{ .RelPermalink }}" class="link black dim">
6 {{ .Title }} 5 {{ .Title }}
7 </a> 6 </a>
8 </h1> 7 {{ if isset .Params "rating" }}
9 <div> 8 {{ .Params.rating }}
10 {{ .Summary }} 9 {{ end }}
11 </div> 10 </h3>
12 </div> 11 <p>{{ .Date | time.Format ":date_full" }}</p>
13</div> 12 <p>
13 <span>{{ .ReadingTime }} min read</span>
14 </p>
15 </hgroup>
16 <div>{{ .Summary | markdownify }}</div>
17</section>
diff --git a/layouts/book/list.html b/layouts/book/list.html
new file mode 100644
index 0000000..25976dd
--- /dev/null
+++ b/layouts/book/list.html
@@ -0,0 +1,31 @@
1{{ define "main" }}
2 <h1>{{ .Title }}</h1>
3 {{ if .Content }}
4 <p>{{- .Content -}}</p>
5 {{ end }}
6 <section>
7 {{ if .IsSection }}
8 {{ range sort .Pages "Date" "desc" }}
9 {{ if ne .Layout "list" }}
10 <div>{{ .Render "summary" }}</div>
11 {{ end }}
12 {{ end }}
13 {{ else }}
14 {{ $metric := .Params.sortby }}
15 {{ $direction := "asc" }}
16 {{ if eq .Params.sortby "rating" }}
17 {{ $direction = "desc" }}
18 {{ end }}
19 {{ $pages := (where .Site.RegularPages "Type" "book") }}
20 {{ $pages = (where $pages "Layout" "!=" "list")}}
21 {{ if eq $direction "desc" }}
22 {{ $pages = (sort ($pages.ByParam $metric).Reverse) }}
23 {{ else }}
24 {{ $pages = (sort ($pages.ByParam $metric)) }}
25 {{ end }}
26 {{ range $pages }}
27 <div>{{ .Render "summary" }}</div>
28 {{ end }}
29 {{ end }}
30 </section>
31{{ end }} \ No newline at end of file
diff --git a/layouts/book/single.html b/layouts/book/single.html
new file mode 100644
index 0000000..baedf32
--- /dev/null
+++ b/layouts/book/single.html
@@ -0,0 +1,40 @@
1{{ define "main" }}
2 <hgroup>
3 <h1>{{ .Title }}</h1>
4 <h6>{{ .Date | time.Format ":date_full" }}</h6>
5 </hgroup>
6 {{ if isset .Params "image" }}
7 {{ with resources.GetRemote .Params.image }}
8 {{ with .Err }}
9 {{ errorf "%s" . }}
10 {{ else }}
11 {{ $image := . }}
12 {{ $image := $image.Resize "250x" }}
13 <img
14 src="{{ $image.RelPermalink }}"
15 width="{{ $image.Width }}"
16 height="{{ $image.Height }}"
17 alt="Book cover of the book {{ .Title }}"
18 />
19 {{ end }}
20 {{ else }}
21 {{ errorf "unable to get remote resource %q" .Params.image }}
22 {{ end }}
23 {{ end }}
24 {{ if isset .Params "amazon" }}
25 <p>
26 <a href="{{ .Params.amazon }}" target="_blank">amazon</a>
27 </p>
28 {{ end }}
29 <div>
30 <p>Rating: </p>
31 {{ if isset .Params "rating" }}
32 {{ $rating := .Params.rating }}
33 {{ range $i, $num := (seq $rating) }}
34
35 {{ end }}
36 {{ else }}
37 <p>N/A</p>
38 {{ end }}
39 </div>
40{{ end }} \ No newline at end of file
diff --git a/layouts/book/summary.html b/layouts/book/summary.html
new file mode 100644
index 0000000..900fb87
--- /dev/null
+++ b/layouts/book/summary.html
@@ -0,0 +1,29 @@
1<section class="flex row gap-1">
2 {{ with resources.GetRemote .Params.image }}
3 {{ with .Err }}
4 {{ errorf "%s" . }}
5 {{ else }}
6 {{ $image := . }}
7 {{ $image := $image.Resize "150x" }}
8 <img
9 src="{{ $image.RelPermalink }}"
10 width="{{ $image.Width }}"
11 height="{{ $image.Height }}"
12 alt="Book cover of the book {{ .Title }}"
13 />
14 {{ end }}
15 {{ else }}
16 {{ errorf "unable to get remote resource %q" .Params.image }}
17 {{ end }}
18 <hgroup>
19 <h3 class="f3 near-black">
20 <a href="{{ .RelPermalink }}" class="link black dim">
21 {{ .Title }}
22 </a>
23 </h3>
24 <p>Rating: {{ .Params.rating }} / 5</p>
25 {{ with .Params.last_read }}
26 <p>Last Read: {{ . | time.Format ":date_full" }}</p>
27 {{ end }}
28 </hgroup>
29</section>
diff --git a/layouts/index.html b/layouts/index.html
index 51f6625..7d9bf2a 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,9 +1,3 @@
1{{ define "main" }} 1{{ define "main" }}
2<div> 2 {{- .Content -}}
3 {{ with .Site.GetPage "post" }} 3{{ end }}
4 {{ range .Pages }}
5 <h1>{{ .Title }}</h1>
6 {{ end }}
7 {{ end }}
8</div>
9{{ end }} \ No newline at end of file
diff --git a/layouts/partials/disclaimer.html b/layouts/partials/disclaimer.html
new file mode 100644
index 0000000..7cac018
--- /dev/null
+++ b/layouts/partials/disclaimer.html
@@ -0,0 +1,2 @@
1{{ $disclaimer := .Site.GetPage "/disclaimer.md" }}
2{{ $disclaimer.Content }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index eb1e7e7..171d3ba 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,5 +1,35 @@
1<footer> 1<footer>
2 <div class="container"> 2 <div class="container">
3 <h3>{{ .Site.Title }}</h3> 3 <div class="flex row space-between">
4 <hgroup>
5 <h3>{{ .Site.Title | upper }}</h3>
6 <p>{{ .Site.Params.description }}</p>
7 <div>
8 <h4>Connect</h4>
9 <ul>
10 {{ range $key, $value := .Site.Social }}
11 <li>
12 {{ partial "social.html" (dict "social" $key "username" $value) }}
13 </li>
14 {{ end }}
15 </ul>
16 </div>
17 </hgroup>
18 <div class="flex col align-end">
19 <h4>Get Around</h4>
20 <ul>
21 {{ range .Site.Menus.main }}
22 <li><a href="{{ .URL }}">{{ .Name }}</a></li>
23 {{ end }}
24 </ul>
25 </div>
26 </div>
27 <div class="flex row space-between">
28 <div>Powered by <a href="https://gohugo.io">Hugo</a> &amp; Blackbear (v{{.Site.Params.themeVersion }})</div>
29 <div>
30 <span title="site version">v{{.Site.Params.siteVersion}}</span>
31 </div>
32 <div>&copy; Copyright {{ now.Format "2006" }} | All Rights Reserved</div>
33 </div>
4 </div> 34 </div>
5</footer> \ No newline at end of file 35</footer> \ No newline at end of file
diff --git a/layouts/partials/func/GetSvg.html b/layouts/partials/func/GetSvg.html
new file mode 100644
index 0000000..bff1fd1
--- /dev/null
+++ b/layouts/partials/func/GetSvg.html
@@ -0,0 +1,5 @@
1{{ $resource := dict }}
2{{ with resources.Get . | minify }}
3 {{ $resource = .Content | safeHTML }}
4{{ end }}
5{{ return $resource }} \ No newline at end of file
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index dbc55b1..d7b2381 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -9,4 +9,4 @@
9 {{- template "_internal/opengraph.html" . -}} 9 {{- template "_internal/opengraph.html" . -}}
10 {{- template "_internal/schema.html" . -}} 10 {{- template "_internal/schema.html" . -}}
11 {{- template "_internal/twitter_cards.html" . -}} 11 {{- template "_internal/twitter_cards.html" . -}}
12</head> \ No newline at end of file 12</head>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 4a9ae70..0137db1 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,13 +1,9 @@
1<header> 1<header>
2 <div class="container"> 2 <div class="container">
3 <nav> 3 <nav id="nav-main" class="flex wrap">
4 <ul> 4 <div class='wordmark'>
5 <li> 5 {{ .Site.Title }}
6 <strong> 6 </div>
7 {{ .Site.Title }}
8 </strong>
9 </li>
10 </ul>
11 <ul> 7 <ul>
12 {{ range .Site.Menus.main }} 8 {{ range .Site.Menus.main }}
13 <li><a href="{{ .URL }}">{{ .Name }}</a></li> 9 <li><a href="{{ .URL }}">{{ .Name }}</a></li>
@@ -15,4 +11,4 @@
15 </ul> 11 </ul>
16 </nav> 12 </nav>
17 </div> 13 </div>
18</header> \ No newline at end of file 14</header>
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
new file mode 100644
index 0000000..f7c95bd
--- /dev/null
+++ b/layouts/partials/scripts.html
@@ -0,0 +1,5 @@
1{{ $scripts := resources.Match "js/*.js" }}
2{{ range $script := $scripts }}
3 {{ $script := $script | minify | fingerprint }}
4 <script src="{{ $script.RelPermalink }}" defer></script>
5{{ end }}
diff --git a/layouts/partials/site-actions.html b/layouts/partials/site-actions.html
new file mode 100644
index 0000000..ac9013a
--- /dev/null
+++ b/layouts/partials/site-actions.html
@@ -0,0 +1,18 @@
1<div id="actions" class="fixed flex row aligned right">
2 <button id="darkmode">
3 <span class="icon" id="lightmode-icon">
4 {{ partial "func/GetSvg" "Lightmode.svg" }}
5 </span>
6 <span class="icon hide" id="darkmode-icon">
7 {{ partial "func/GetSvg" "Darkmode.svg" }}
8 </span>
9 </button>
10 <button id="fullscreen" class="flex row centered" title="fullscreen toggle">
11 <span class="icon" id="fullscreen-icon">
12 {{ partial "func/GetSvg" "Fullscreen.svg" }}
13 </span>
14 <span class="icon hide" id="smallscreen-icon">
15 {{ partial "func/GetSvg" "Smallscreen.svg" }}
16 </span>
17 </button>
18</div> \ No newline at end of file
diff --git a/layouts/partials/social.html b/layouts/partials/social.html
new file mode 100644
index 0000000..03645ad
--- /dev/null
+++ b/layouts/partials/social.html
@@ -0,0 +1,16 @@
1{{ $social := .social }}
2{{ $username := .username }}
3
4{{ $url := "" }}
5
6{{ if eq $social "github" }}
7 {{ $url = printf "https://github.com/%s" $username }}
8{{ else if eq $social "linkedin" }}
9 {{ $url = printf "https://www.linkedin.com/in/%s" $username }}
10{{ else }}
11 {{ $url = "#" }}
12{{ end }}
13
14<a href="{{ $url }}" target="_blank">
15 {{ title $social }}
16</a> \ No newline at end of file
diff --git a/layouts/partials/updated_posts.html b/layouts/partials/updated_posts.html
new file mode 100644
index 0000000..7010a5b
--- /dev/null
+++ b/layouts/partials/updated_posts.html
@@ -0,0 +1,17 @@
1{{ $lastBuildTime := time "2021-09-08T12:51:38-0400" }}
2{{ $updatedPosts := slice }}
3
4{{ range .Site.Pages }}
5 {{ if .Lastmod.After $lastBuildTime }}
6 <li>{{ .Title }} - {{ .Lastmod }}</li>
7 {{ end }}
8{{ end }}
9
10<h2>Updated Posts:</h2>
11<ul>
12 {{ range $updatedPosts }}
13 <li>{{ . }}</li>
14 {{ end }}
15</ul>
16
17{{ $currentTime := now.UTC }}
diff --git a/layouts/post/single.html b/layouts/post/single.html
new file mode 100644
index 0000000..ca0f556
--- /dev/null
+++ b/layouts/post/single.html
@@ -0,0 +1,19 @@
1{{ define "main" }}
2 {{ if not .Params.dontDisclaim }}
3 {{ partial "disclaimer" . }}
4 {{ end }}
5 <hgroup>
6 <h1>{{ .Title }}</h1>
7 <h6>{{ .Date | time.Format ":date_full" }}</h6>
8 {{ with .Params.categories }}
9 <div class="pills">
10 {{ range $value := . }}
11 <a href="{{ $.Site.BaseURL }}/categories/{{ $.Site.Taxonomies.categories.path }}/{{ $value | urlize }}">{{ $value }}</a>
12 {{ end }}
13 </div>
14 {{ end }}
15 </hgroup>
16 <section class="content">
17 {{- .Content -}}
18 </section>
19{{ end }}
diff --git a/layouts/robots.txt b/layouts/robots.txt
new file mode 100644
index 0000000..45a37d1
--- /dev/null
+++ b/layouts/robots.txt
@@ -0,0 +1,11 @@
1User-agent: Googlebot
2Allow: /
3
4User-agent: ChatGPT-User
5Disallow: /
6
7User-agent: GPTBot
8Disallow: /
9
10User-agent: *
11Disallow: / \ No newline at end of file
diff --git a/layouts/shortcodes/projects.html b/layouts/shortcodes/projects.html
new file mode 100644
index 0000000..b9cf8b5
--- /dev/null
+++ b/layouts/shortcodes/projects.html
@@ -0,0 +1,12 @@
1{{ $projects := where .Site.RegularPages "Params.categories" "intersect" (slice "projects") }}
2
3<ul>
4{{ range $projects }}
5 <li>
6 <a href="{{ .Permalink }}">{{ .Title }}</a>
7 {{ with .Description }}
8 &mdash; {{ . }}
9 {{ end }}
10 </li>
11{{ end }}
12</ul> \ No newline at end of file