diff options
author | JJ <nicetry@noemail.com> | 2025-03-19 14:56:26 +0000 |
---|---|---|
committer | JJ <nicetry@noemail.com> | 2025-03-19 14:56:26 +0000 |
commit | 16f52b7bef745097f7076dde76715db378b54343 (patch) | |
tree | cfcacda8adced2059dcc120d2bc2446d3c4f960a /layouts |
first commit
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 6 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 38 | ||||
-rw-r--r-- | layouts/_default/list.html | 44 | ||||
-rw-r--r-- | layouts/_default/single.html | 17 | ||||
-rw-r--r-- | layouts/index.html | 3 | ||||
-rw-r--r-- | layouts/notes/list.html | 12 | ||||
-rw-r--r-- | layouts/partials/custom_body.html | 3 | ||||
-rw-r--r-- | layouts/partials/custom_head.html | 3 | ||||
-rw-r--r-- | layouts/partials/favicon.html | 2 | ||||
-rw-r--r-- | layouts/partials/footer.html | 1 | ||||
-rw-r--r-- | layouts/partials/header.html | 7 | ||||
-rw-r--r-- | layouts/partials/nav.html | 9 | ||||
-rw-r--r-- | layouts/partials/seo_tags.html | 22 | ||||
-rw-r--r-- | layouts/projects/list.html | 40 | ||||
-rw-r--r-- | layouts/robots.txt | 2 | ||||
-rw-r--r-- | layouts/snippets/list.html | 40 |
16 files changed, 249 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..c6b3dfd --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,6 @@ +{{ define "title" }}404{{ end }} + +{{ define "main" }} +<h1>404</h1> +<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2> +{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..56818d7 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}"> + <head> + <meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" /> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + {{- partial "favicon.html" . -}} + <title> + {{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title + }}{{- end }} + </title> + + {{- partial "seo_tags.html" . -}} + <meta name="referrer" content="no-referrer-when-downgrade" /> + <link rel="stylesheet" href="/style.css" /> + <link + href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" + rel="stylesheet" + /> + {{ with .OutputFormats.Get "rss" -}} {{ printf ` + <link rel="%s" type="%s" href="%s" title="%s" /> + ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} {{- + partial "custom_head.html" . -}} + <link rel="preconnect" href="https://fonts.googleapis.com" /> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> + <link + href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap" + rel="stylesheet" + /> + <script src="/index.js" defer></script> + </head> + + <body> + <header>{{- partial "header.html" . -}}</header> + <main>{{- block "main" . }}{{- end }}</main> + <footer>{{- partial "footer.html" . -}}</footer> + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..49da071 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,44 @@ +{{ define "main" }} +<content> + {{ if .Data.Singular }} + <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3> + <small> + <a href="{{ "blog" | relURL }}">Remove filter</a> + </small> + {{ end }} + <ul class="blog-posts"> + {{ range .Pages }} + <li> + <span> + <i> + <time datetime='{{ .Date.Format "2006-01-02" }}'> + {{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }} + </time> + </i> + </span> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </li> + {{ else }} + <li> + No posts yet + </li> + {{ end }} + </ul> + <small> + <div> + {{ $currentSection := .Section }} + {{ range $tag, $taxonomy := .Site.Taxonomies.tags }} + {{ $count:= 0 }} + {{ range $taxonomy.Pages }} + {{ if eq .Section $currentSection }} + {{ $count = add $count 1 }} + {{ end }} + {{ end }} + {{ if gt $count 0 }} + <a href="{{ $taxonomy.Page.Permalink }}">#{{ $taxonomy.Page.Title }}</a> + {{ end }} + {{ end }} + </div> + </small> +</content> +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..5d0d520 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,17 @@ +{{ define "main" }} {{ if eq .Type "blog" }}{{ if not .Params.menu }} +<h1>{{ .Title }}</h1> +<p> + <i> + <time datetime='{{ .Date.Format "2006-01-02" }}'> + {{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }} + </time> + </i> +</p> +{{ end }}{{ end }} +<content> {{ .Content }} </content> +<p> + {{ range (.GetTerms "tags") }} + <a href="{{ .Permalink }}">#{{ lower .LinkTitle }}</a> + {{ end }} +</p> +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..9983b08 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,3 @@ +{{ define "main" }} +{{ .Content }} +{{ end }} diff --git a/layouts/notes/list.html b/layouts/notes/list.html new file mode 100644 index 0000000..b34d8b4 --- /dev/null +++ b/layouts/notes/list.html @@ -0,0 +1,12 @@ +{{ define "main" }} +<content> + {{ range $course, $taxonomy := site.Taxonomies.course }} + <h2>{{ $course | title }}</h2> + <ul class="blog-posts"> + {{ range $taxonomy.Pages }} {{ if eq .Type "notes" }} + <li><a href="{{ .Permalink }}">{{ .Title }}</a></li> + {{ end }} {{ end }} + </ul> + {{ end }} +</content> +{{ end }} diff --git a/layouts/partials/custom_body.html b/layouts/partials/custom_body.html new file mode 100644 index 0000000..951fb15 --- /dev/null +++ b/layouts/partials/custom_body.html @@ -0,0 +1,3 @@ + <!-- A partial to be overwritten by the user. + Simply place a custom_body.html into + your local /layouts/partials-directory --> diff --git a/layouts/partials/custom_head.html b/layouts/partials/custom_head.html new file mode 100644 index 0000000..4c53c40 --- /dev/null +++ b/layouts/partials/custom_head.html @@ -0,0 +1,3 @@ +<!-- A partial to be overwritten by the user. + Simply place a custom_head.html into + your local /layouts/partials-directory --> diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html new file mode 100644 index 0000000..ccf1a5d --- /dev/null +++ b/layouts/partials/favicon.html @@ -0,0 +1,2 @@ +{{ with .Site.Params.favicon }} +<link rel="shortcut icon" href="{{ . | absURL }}" />{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..861b2cc --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1 @@ +<p>Find me here: <a href="https://git.jezl.xyz">git</a></p> diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..12fe8b2 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,7 @@ +<div> + <img src="/images/avatar/avatar.jpg" alt="avatar "> + <a href="{{ "" | relURL }}" class="title"> + <h2>{{ .Site.Title }}</h2> + </a> + <nav>{{- partial "nav.html" . -}}</nav> +</div> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..be5539c --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,9 @@ +{{ with .Site.GetPage "/blog" }} +<a href="{{ "blog" | relURL }}">blog</a> +{{ end }} +{{ with .Site.GetPage "/snippets" }} +<a href="{{ "snippets" | relURL }}">snippets</a> +{{ end }} +{{ with .Site.GetPage "/projects" }} +<a href="{{ "projects" | relURL }}">projects</a> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/seo_tags.html b/layouts/partials/seo_tags.html new file mode 100644 index 0000000..7cea9a1 --- /dev/null +++ b/layouts/partials/seo_tags.html @@ -0,0 +1,22 @@ +<!-- Primary Meta Tags --> +<meta + name="title" + content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}" +/> +<meta + name="description" + content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" +/> +<meta name="keywords" content="{{ if .IsPage}}{{ range $index, $tag := +.Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := +.Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ +end }}{{ end }}{{ end }}" /> + +<!-- Open Graph / Facebook --> +{{ template "_internal/opengraph.html" . }} + +<!-- Twitter --> +{{ template "_internal/twitter_cards.html" . }} + +<!-- Microdata --> +{{ template "_internal/schema.html" . }} diff --git a/layouts/projects/list.html b/layouts/projects/list.html new file mode 100644 index 0000000..1f9fc51 --- /dev/null +++ b/layouts/projects/list.html @@ -0,0 +1,40 @@ +{{ define "main" }} +<content> + {{ if .Data.Singular }} + <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3> + <small> + <a href="{{ "blog" | relURL }}">Remove filter</a> + </small> + {{ end }} + <ul class="blog-posts"> + {{ range .Pages }} + <li> + <a href="{{ .Params.Link }}"> + {{ .Title }} - + </a> + <i> {{ .Description }}</i> + </li> + {{ else }} + <li> + No posts yet + </li> + {{ end }} + </ul> + <small> + <div> + {{ $currentSection := .Section }} + {{ range $tag, $taxonomy := .Site.Taxonomies.tags }} + {{ $count:= 0 }} + {{ range $taxonomy.Pages }} + {{ if eq .Section $currentSection }} + {{ $count = add $count 1 }} + {{ end }} + {{ end }} + {{ if gt $count 0 }} + <a href="{{ $taxonomy.Page.Permalink }}">#{{ $taxonomy.Page.Title }}</a> + {{ end }} + {{ end }} + </div> + </small> +</content> +{{ end }} diff --git a/layouts/robots.txt b/layouts/robots.txt new file mode 100644 index 0000000..0326f5c --- /dev/null +++ b/layouts/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/layouts/snippets/list.html b/layouts/snippets/list.html new file mode 100644 index 0000000..2dc6cd4 --- /dev/null +++ b/layouts/snippets/list.html @@ -0,0 +1,40 @@ +{{ define "main" }} +<content> + {{ if .Data.Singular }} + <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3>ijkdwnwjka + <small> + <a href="{{ "blog" | relURL }}">Remove filter</a> + </small> + {{ end }} + <ul class="blog-posts"> + {{ range .Pages }} + <li> + <a href="{{ .Permalink }}"> + + {{ .Title }} + </a> + </li> + {{ else }} + <li> + No posts yet + </li> + {{ end }} + </ul> + <small> + <div> + {{ $currentSection := .Section }} + {{ range $tag, $taxonomy := .Site.Taxonomies.tags }} + {{ $count:= 0 }} + {{ range $taxonomy.Pages }} + {{ if eq .Section $currentSection }} + {{ $count = add $count 1 }} + {{ end }} + {{ end }} + {{ if gt $count 0 }} + <a href="{{ $taxonomy.Page.Permalink }}">#{{ $taxonomy.Page.Title }}</a> + {{ end }} + {{ end }} + </div> + </small> +</content> +{{ end }} |