diff options
author | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-03 23:44:31 -0400 |
---|---|---|
committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-03 23:44:31 -0400 |
commit | 93a4ba55f2159e69aa1fcdaa1cf87c09e7455017 (patch) | |
tree | 1d5ccef993cfa21b1aaf0f4c28dd9994e111cbc3 | |
parent | 81200fa6a598557f36593c950d7a63c52aa0b22f (diff) |
add changelog, assets, new partial
-rw-r--r-- | archetypes/changelog.md | 15 | ||||
-rw-r--r-- | archetypes/post.md | 1 | ||||
-rw-r--r-- | assets/css/main.css | 6 | ||||
-rw-r--r-- | assets/js/fullscreen.js | 30 | ||||
-rw-r--r-- | layouts/404.html | 7 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | layouts/_default/list.html | 9 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 4 | ||||
-rw-r--r-- | layouts/post/single.html | 2 | ||||
-rw-r--r-- | layouts/robots.txt | 11 | ||||
-rw-r--r-- | static/css/main.css | 16 |
13 files changed, 86 insertions, 23 deletions
diff --git a/archetypes/changelog.md b/archetypes/changelog.md new file mode 100644 index 0000000..3a002ba --- /dev/null +++ b/archetypes/changelog.md | |||
@@ -0,0 +1,15 @@ | |||
1 | --- | ||
2 | title: {{ .Date }} | ||
3 | date: {{ .Date }} | ||
4 | draft: true | ||
5 | --- | ||
6 | |||
7 | ## Changes | ||
8 | |||
9 | - Change 1 | ||
10 | - Change 2 | ||
11 | |||
12 | ## Notes | ||
13 | |||
14 | - Note 1 | ||
15 | - Note 2 \ No newline at end of file | ||
diff --git a/archetypes/post.md b/archetypes/post.md index d62ae73..43dca9a 100644 --- a/archetypes/post.md +++ b/archetypes/post.md | |||
@@ -1,4 +1,5 @@ | |||
1 | --- | 1 | --- |
2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" | 2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" |
3 | date: {{ .Date }} | 3 | date: {{ .Date }} |
4 | draft: true | ||
4 | --- | 5 | --- |
diff --git a/assets/css/main.css b/assets/css/main.css index 792f1f6..97d1f73 100644 --- a/assets/css/main.css +++ b/assets/css/main.css | |||
@@ -1,3 +1,7 @@ | |||
1 | :fullscreen { | ||
2 | color: blue; | ||
3 | } | ||
4 | |||
1 | body { | 5 | body { |
2 | min-height: 100vh; | 6 | min-height: 100vh; |
3 | } | 7 | } |
@@ -71,4 +75,4 @@ footer { | |||
71 | text-transform: uppercase; | 75 | text-transform: uppercase; |
72 | font-weight: 600; | 76 | font-weight: 600; |
73 | } | 77 | } |
74 | 78 | \ No newline at end of file | |
diff --git a/assets/js/fullscreen.js b/assets/js/fullscreen.js new file mode 100644 index 0000000..e191854 --- /dev/null +++ b/assets/js/fullscreen.js | |||
@@ -0,0 +1,30 @@ | |||
1 | // get with web apis #fullscren element and on click toggle fullscreen | ||
2 | const fullscreen = document.getElementById('fullscreen'); | ||
3 | const elem = document.documentElement; | ||
4 | fullscreen.addEventListener('click', () => { | ||
5 | if (document.fullscreenElement) { | ||
6 | closeFullscreen(); | ||
7 | } else { | ||
8 | openFullscreen(); | ||
9 | } | ||
10 | }); | ||
11 | |||
12 | function openFullscreen() { | ||
13 | if (elem.requestFullscreen) { | ||
14 | elem.requestFullscreen(); | ||
15 | } else if (elem.webkitRequestFullscreen) { /* Safari */ | ||
16 | elem.webkitRequestFullscreen(); | ||
17 | } else if (elem.msRequestFullscreen) { /* IE11 */ | ||
18 | elem.msRequestFullscreen(); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | function closeFullscreen() { | ||
23 | if (document.exitFullscreen) { | ||
24 | document.exitFullscreen(); | ||
25 | } else if (document.webkitExitFullscreen) { /* Safari */ | ||
26 | document.webkitExitFullscreen(); | ||
27 | } else if (document.msExitFullscreen) { /* IE11 */ | ||
28 | document.msExitFullscreen(); | ||
29 | } | ||
30 | } \ No newline at end of file | ||
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..bb27232 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html | |||
@@ -2,6 +2,7 @@ | |||
2 | <html lang="en" data-theme="dark"> | 2 | <html lang="en" data-theme="dark"> |
3 | {{- partial "head.html" . -}} | 3 | {{- partial "head.html" . -}} |
4 | <body> | 4 | <body> |
5 | <button id="fullscreen">Fullscreen</button> | ||
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 a86ef3a..38ef025 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html | |||
@@ -1,6 +1,9 @@ | |||
1 | {{ define "main" }} | 1 | {{ define "main" }} |
2 | <article> | 2 | <article style="width:70ch;"> |
3 | <h1>{{ .Title }}</h1> | 3 | <h1>{{ .Title }}</h1> |
4 | {{ if .Content }} | ||
5 | <p>{{ .Content }}</p> | ||
6 | {{ end }} | ||
4 | <section> | 7 | <section> |
5 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} | 8 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} |
6 | <div>{{ .Render "summary" }}</div> | 9 | <div>{{ .Render "summary" }}</div> |
@@ -11,7 +14,9 @@ | |||
11 | {{ if .HasPrev }} | 14 | {{ if .HasPrev }} |
12 | <a href="{{ .Prev.URL }}">prev</a> | 15 | <a href="{{ .Prev.URL }}">prev</a> |
13 | {{ end }} | 16 | {{ end }} |
14 | <p>{{ .PageNumber }} of {{ .TotalPages }}</p> | 17 | {{ if (or (.HasPrev) (.HasNext)) }} |
18 | <p>{{ .PageNumber }} of {{ .TotalPages }}</p> | ||
19 | {{ end }} | ||
15 | {{ if .HasNext }} | 20 | {{ if .HasNext }} |
16 | <a href="{{ .Next.URL }}">next</a> | 21 | <a href="{{ .Next.URL }}">next</a> |
17 | {{ end }} | 22 | {{ end }} |
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1564845..996ad9e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html | |||
@@ -3,7 +3,7 @@ | |||
3 | <section> | 3 | <section> |
4 | <h1>{{- .Title -}}</h1> | 4 | <h1>{{- .Title -}}</h1> |
5 | </section> | 5 | </section> |
6 | <section> | 6 | <section class="content"> |
7 | {{- .Content -}} | 7 | {{- .Content -}} |
8 | </section> | 8 | </section> |
9 | </article> | 9 | </article> |
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d7b2381..2106ef3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html | |||
@@ -1,8 +1,8 @@ | |||
1 | <head> | 1 | <head> |
2 | <title>{{ .Title }}</title> | 2 | <title>{{ .Title }}</title> |
3 | {{ with resources.Get "css/pico.min.css" }} | 3 | <!-- {{ with resources.Get "css/pico.min.css" }} |
4 | <link rel="stylesheet" href="{{ .RelPermalink }}"> | 4 | <link rel="stylesheet" href="{{ .RelPermalink }}"> |
5 | {{ end }} | 5 | {{ end }} --> |
6 | {{ with resources.Get "css/main.css" }} | 6 | {{ with resources.Get "css/main.css" }} |
7 | <link rel="stylesheet" href="{{ .RelPermalink }}"> | 7 | <link rel="stylesheet" href="{{ .RelPermalink }}"> |
8 | {{ end }} | 8 | {{ end }} |
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..152c32b --- /dev/null +++ b/layouts/partials/scripts.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {{ $scripts := resources.Match "js/*.js" }} | ||
2 | {{ range $script := $scripts }} | ||
3 | <script src="{{ $script.RelPermalink }}" defer></script> | ||
4 | {{ end }} \ No newline at end of file | ||
diff --git a/layouts/post/single.html b/layouts/post/single.html index 432b9df..f2a333e 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html | |||
@@ -4,7 +4,7 @@ | |||
4 | <h1>{{ .Title }}</h1> | 4 | <h1>{{ .Title }}</h1> |
5 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | 5 | <h6>{{ .Date | time.Format ":date_full" }}</h6> |
6 | </section> | 6 | </section> |
7 | <section> | 7 | <section class="content"> |
8 | {{- .Content -}} | 8 | {{- .Content -}} |
9 | </section> | 9 | </section> |
10 | </article> | 10 | </article> |
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 @@ | |||
1 | User-agent: Googlebot | ||
2 | Allow: / | ||
3 | |||
4 | User-agent: ChatGPT-User | ||
5 | Disallow: / | ||
6 | |||
7 | User-agent: GPTBot | ||
8 | Disallow: / | ||
9 | |||
10 | User-agent: * | ||
11 | Disallow: / \ No newline at end of file | ||
diff --git a/static/css/main.css b/static/css/main.css deleted file mode 100644 index d4c7edd..0000000 --- a/static/css/main.css +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | header { | ||
2 | background: red; | ||
3 | } | ||
4 | |||
5 | footer { | ||
6 | background: blue; | ||
7 | color: red; | ||
8 | } | ||
9 | |||
10 | main { | ||
11 | background: green; | ||
12 | } | ||
13 | |||
14 | body { | ||
15 | background: yellow; | ||
16 | } \ No newline at end of file | ||