diff options
author | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-09 21:08:24 -0400 |
---|---|---|
committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-09 21:08:24 -0400 |
commit | d0e7f43601e90229b95191a1cdc85039e233b622 (patch) | |
tree | 873074bb67ef58311067209434243b421d7f675e | |
parent | 4e30ae95eaf52a7f427bdf020d118f40e00ab291 (diff) |
add icons, refine styles, update layouts
-rwxr-xr-x | assets/Darkmode.svg | 12 | ||||
-rwxr-xr-x | assets/Lightmode.svg | 39 | ||||
-rw-r--r-- | assets/css/main.css | 6 | ||||
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/summary.html | 3 | ||||
-rw-r--r-- | layouts/book/list.html | 33 | ||||
-rw-r--r-- | layouts/book/single.html | 15 | ||||
-rw-r--r-- | layouts/partials/site-actions.html | 18 |
8 files changed, 120 insertions, 8 deletions
diff --git a/assets/Darkmode.svg b/assets/Darkmode.svg new file mode 100755 index 0000000..e6d13b6 --- /dev/null +++ b/assets/Darkmode.svg | |||
@@ -0,0 +1,12 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | ||
3 | <svg width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"> | ||
4 | <g transform="matrix(1,0,0,1,-218,-222)"> | ||
5 | <g id="Darkmode" transform="matrix(1,0,0,1,218,222)"> | ||
6 | <rect x="0" y="0" width="200" height="200" style="fill:none;"/> | ||
7 | <g transform="matrix(1,0,0,1,-218,-222)"> | ||
8 | <path d="M365.271,362.102C353.894,375.496 336.932,384 318,384C283.781,384 256,356.219 256,322C256,293.05 275.885,268.708 302.729,261.898C303.974,261.582 306.224,261.239 309.047,260.973C313.025,260.577 316.857,262.591 318.786,266.093C320.716,269.595 320.372,273.91 317.913,277.061C316.807,278.445 315.809,279.915 314.908,281.449C311.365,287.481 309.333,294.505 309.333,302C309.333,324.445 327.555,342.667 350,342.667C351.04,342.667 352.072,342.628 353.092,342.551C355.017,342.406 356.904,342.127 358.744,341.723C362.735,340.836 366.862,342.48 369.15,345.867C371.437,349.255 371.42,353.697 369.107,357.068C367.92,358.817 366.636,360.495 365.271,362.102ZM288.511,294.008C281.585,301.301 277.333,311.158 277.333,322C277.333,344.445 295.555,362.667 318,362.667C322.27,362.667 326.387,362.007 330.255,360.784C305.705,352.531 288,329.317 288,302C288,299.292 288.174,296.625 288.511,294.008Z"/> | ||
9 | </g> | ||
10 | </g> | ||
11 | </g> | ||
12 | </svg> | ||
diff --git a/assets/Lightmode.svg b/assets/Lightmode.svg new file mode 100755 index 0000000..f4c4319 --- /dev/null +++ b/assets/Lightmode.svg | |||
@@ -0,0 +1,39 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | ||
3 | <svg width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"> | ||
4 | <g transform="matrix(1,0,0,1,0,-221)"> | ||
5 | <g id="Lightmode" transform="matrix(1,0,0,1,0,221)"> | ||
6 | <rect x="0" y="0" width="200" height="200" style="fill:none;"/> | ||
7 | <g transform="matrix(1,0,0,1,0,-221)"> | ||
8 | <path d="M100,259C134.219,259 162,286.781 162,321C162,355.219 134.219,383 100,383C65.781,383 38,355.219 38,321C38,286.781 65.781,259 100,259ZM100,280.333C77.555,280.333 59.333,298.555 59.333,321C59.333,343.445 77.555,361.667 100,361.667C122.445,361.667 140.667,343.445 140.667,321C140.667,298.555 122.445,280.333 100,280.333Z"/> | ||
9 | </g> | ||
10 | <g transform="matrix(1,0,0,1,-40,-249)"> | ||
11 | <path d="M140,287C174.219,287 202,314.781 202,349C202,383.219 174.219,411 140,411C105.781,411 78,383.219 78,349C78,314.781 105.781,287 140,287ZM140,308.333C117.555,308.333 99.333,326.555 99.333,349C99.333,371.445 117.555,389.667 140,389.667C162.445,389.667 180.667,371.445 180.667,349C180.667,326.555 162.445,308.333 140,308.333Z" style="fill:none;"/> | ||
12 | </g> | ||
13 | <g transform="matrix(1.00049,-0.00710059,-0.00710059,1.10296,1.86158,-247.993)"> | ||
14 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
15 | </g> | ||
16 | <g transform="matrix(0.712474,0.702432,-0.78493,0.774889,276.674,-215.462)"> | ||
17 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
18 | </g> | ||
19 | <g transform="matrix(0.00710059,1.00049,-1.10296,-0.00710059,447.993,1.86158)"> | ||
20 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
21 | </g> | ||
22 | <g transform="matrix(-0.702432,0.712474,-0.774889,-0.78493,415.462,276.674)"> | ||
23 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
24 | </g> | ||
25 | <g transform="matrix(-1.00049,0.00710059,0.00710059,-1.10296,198.138,447.993)"> | ||
26 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
27 | </g> | ||
28 | <g transform="matrix(-0.712474,-0.702432,0.78493,-0.774889,-76.6738,415.462)"> | ||
29 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
30 | </g> | ||
31 | <g transform="matrix(-0.00710059,-1.00049,1.10296,0.00710059,-247.993,198.138)"> | ||
32 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
33 | </g> | ||
34 | <g transform="matrix(0.702432,-0.712474,0.774889,0.78493,-215.462,-76.6738)"> | ||
35 | <path d="M89.157,243.55C89.12,238.213 93.866,233.91 99.751,233.948C105.635,233.985 110.443,238.35 110.481,243.688L110.61,261.822C110.648,267.159 105.901,271.462 100.017,271.424C94.132,271.386 89.324,267.022 89.286,261.684L89.157,243.55Z"/> | ||
36 | </g> | ||
37 | </g> | ||
38 | </g> | ||
39 | </svg> | ||
diff --git a/assets/css/main.css b/assets/css/main.css index a7d2bf8..af25dae 100644 --- a/assets/css/main.css +++ b/assets/css/main.css | |||
@@ -110,6 +110,12 @@ footer { | |||
110 | font-weight: 600; | 110 | font-weight: 600; |
111 | } | 111 | } |
112 | 112 | ||
113 | .icon span { | ||
114 | display: inline-block; | ||
115 | width: fit-content; | ||
116 | height: fit-content; | ||
117 | } | ||
118 | |||
113 | .icon svg { | 119 | .icon svg { |
114 | width: 1em; | 120 | width: 1em; |
115 | height: 1em; | 121 | height: 1em; |
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 38ef025..c265f91 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html | |||
@@ -1,5 +1,5 @@ | |||
1 | {{ define "main" }} | 1 | {{ define "main" }} |
2 | <article style="width:70ch;"> | 2 | <article> |
3 | <h1>{{ .Title }}</h1> | 3 | <h1>{{ .Title }}</h1> |
4 | {{ if .Content }} | 4 | {{ if .Content }} |
5 | <p>{{ .Content }}</p> | 5 | <p>{{ .Content }}</p> |
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 0753995..5e4ac4b 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html | |||
@@ -4,6 +4,9 @@ | |||
4 | <a href="{{ .RelPermalink }}" class="link black dim"> | 4 | <a href="{{ .RelPermalink }}" class="link black dim"> |
5 | {{ .Title }} | 5 | {{ .Title }} |
6 | </a> | 6 | </a> |
7 | {{ if isset .Params "rating" }} | ||
8 | {{ .Params.rating }} | ||
9 | {{ end }} | ||
7 | </h1> | 10 | </h1> |
8 | <p> | 11 | <p> |
9 | {{ .Date | time.Format ":date_full" }} | 12 | {{ .Date | time.Format ":date_full" }} |
diff --git a/layouts/book/list.html b/layouts/book/list.html new file mode 100644 index 0000000..628d8b8 --- /dev/null +++ b/layouts/book/list.html | |||
@@ -0,0 +1,33 @@ | |||
1 | {{ define "main" }} | ||
2 | <article> | ||
3 | <h1>{{ .Title }}</h1> | ||
4 | {{ if .Content }} | ||
5 | <p>{{- .Content -}}</p> | ||
6 | {{ end }} | ||
7 | <section> | ||
8 | {{ if .IsSection }} | ||
9 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} | ||
10 | {{ if ne .Layout "list" }} | ||
11 | <div>{{ .Render "summary" }}</div> | ||
12 | {{ end }} | ||
13 | {{ end }} | ||
14 | {{ else }} | ||
15 | {{ $metric := .Params.sortby }} | ||
16 | {{ $direction := "asc" }} | ||
17 | {{ if eq .Params.sortby "rating" }} | ||
18 | {{ $direction = "desc" }} | ||
19 | {{ end }} | ||
20 | {{ $pages := (where .Site.RegularPages "Type" "book") }} | ||
21 | {{ $pages = (where $pages "Layout" "!=" "list")}} | ||
22 | {{ if eq $direction "desc" }} | ||
23 | {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} | ||
24 | {{ else }} | ||
25 | {{ $pages = (sort ($pages.ByParam $metric)) }} | ||
26 | {{ end }} | ||
27 | {{ range $pages }} | ||
28 | <div>{{ .Render "summary" }}</div> | ||
29 | {{ end }} | ||
30 | {{ end }} | ||
31 | </section> | ||
32 | </article> | ||
33 | {{ end }} \ No newline at end of file | ||
diff --git a/layouts/book/single.html b/layouts/book/single.html index 3ffb236..0bbd265 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html | |||
@@ -4,7 +4,20 @@ | |||
4 | <h4>{{ .Params.author }}</h4> | 4 | <h4>{{ .Params.author }}</h4> |
5 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | 5 | <h6>{{ .Date | time.Format ":date_full" }}</h6> |
6 | {{ if isset .Params "image" }} | 6 | {{ if isset .Params "image" }} |
7 | <img src="{{ .Params.image }}" alt="Book cover of the book {{ .Title }}" /> | 7 | {{ with resources.GetRemote .Params.image }} |
8 | {{ with .Err }} | ||
9 | {{ errorf "%s" . }} | ||
10 | {{ else }} | ||
11 | <img | ||
12 | src="{{ .RelPermalink }}" | ||
13 | width="{{ .Width }}" | ||
14 | height="{{ .Height }}" | ||
15 | alt="Book cover of the book {{ .Title }}" | ||
16 | /> | ||
17 | {{ end }} | ||
18 | {{ else }} | ||
19 | {{ errorf "unable to get remote resource %q" .Params.image }} | ||
20 | {{ end }} | ||
8 | {{ end }} | 21 | {{ end }} |
9 | {{ if isset .Params "amazon" }} | 22 | {{ if isset .Params "amazon" }} |
10 | <p> | 23 | <p> |
diff --git a/layouts/partials/site-actions.html b/layouts/partials/site-actions.html index b9afa66..ac9013a 100644 --- a/layouts/partials/site-actions.html +++ b/layouts/partials/site-actions.html | |||
@@ -1,12 +1,18 @@ | |||
1 | <div id="actions" class="fixed flex row aligned right"> | 1 | <div id="actions" class="fixed flex row aligned right"> |
2 | <button id="darkmode">Dark Mode</button> | 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> | ||
3 | <button id="fullscreen" class="flex row centered" title="fullscreen toggle"> | 10 | <button id="fullscreen" class="flex row centered" title="fullscreen toggle"> |
4 | <div class="icon" id="fullscreen-icon"> | 11 | <span class="icon" id="fullscreen-icon"> |
5 | {{ partial "func/GetSvg" "Fullscreen.svg" }} | 12 | {{ partial "func/GetSvg" "Fullscreen.svg" }} |
6 | </div> | 13 | </span> |
7 | <div class="icon hide" id="smallscreen-icon"> | 14 | <span class="icon hide" id="smallscreen-icon"> |
8 | {{ partial "func/GetSvg" "Smallscreen.svg" }} | 15 | {{ partial "func/GetSvg" "Smallscreen.svg" }} |
9 | </div> | 16 | </span> |
10 | or [/] | ||
11 | </button> | 17 | </button> |
12 | </div> \ No newline at end of file | 18 | </div> \ No newline at end of file |