diff options
| author | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-12 23:40:26 -0400 |
|---|---|---|
| committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-12 23:40:26 -0400 |
| commit | 2545016f8d6b63b0d857fc20fdd7276d2f0fc2a9 (patch) | |
| tree | 892231613f8bb8120b7b3fc7e170c49a8001f899 | |
| parent | 6e6412e4a693ddc2da5e4611363fb882ad6497be (diff) | |
Layout refinements. add config, disclaimer
| -rw-r--r-- | assets/css/main.css | 48 | ||||
| -rw-r--r-- | config.toml | 3 | ||||
| -rw-r--r-- | layouts/_default/list.html | 19 | ||||
| -rw-r--r-- | layouts/_default/summary.html | 18 | ||||
| -rw-r--r-- | layouts/book/list.html | 54 | ||||
| -rw-r--r-- | layouts/partials/disclaimer.html | 2 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 64 | ||||
| -rw-r--r-- | layouts/post/single.html | 5 |
8 files changed, 79 insertions, 134 deletions
diff --git a/assets/css/main.css b/assets/css/main.css index 4574690..c1aae11 100644 --- a/assets/css/main.css +++ b/assets/css/main.css | |||
| @@ -1,7 +1,3 @@ | |||
| 1 | :fullscreen { | ||
| 2 | color: blue; | ||
| 3 | } | ||
| 4 | |||
| 5 | body { | 1 | body { |
| 6 | min-height: 100vh; | 2 | min-height: 100vh; |
| 7 | } | 3 | } |
| @@ -10,14 +6,6 @@ body::-webkit-scrollbar { | |||
| 10 | display: none;; | 6 | display: none;; |
| 11 | } | 7 | } |
| 12 | 8 | ||
| 13 | #content { | ||
| 14 | width: 65ch; | ||
| 15 | } | ||
| 16 | |||
| 17 | #content::first-letter { | ||
| 18 | initial-letter: 2; | ||
| 19 | } | ||
| 20 | |||
| 21 | main { | 9 | main { |
| 22 | height: inherit; | 10 | height: inherit; |
| 23 | display: flex; | 11 | display: flex; |
| @@ -25,10 +13,6 @@ main { | |||
| 25 | justify-content: stretch; | 13 | justify-content: stretch; |
| 26 | } | 14 | } |
| 27 | 15 | ||
| 28 | footer { | ||
| 29 | background: #00000055; | ||
| 30 | } | ||
| 31 | |||
| 32 | .fixed { | 16 | .fixed { |
| 33 | position: fixed; | 17 | position: fixed; |
| 34 | top: 0; | 18 | top: 0; |
| @@ -66,6 +50,14 @@ footer { | |||
| 66 | flex-direction: row; | 50 | flex-direction: row; |
| 67 | } | 51 | } |
| 68 | 52 | ||
| 53 | .space-between { | ||
| 54 | justify-content: space-between; | ||
| 55 | } | ||
| 56 | |||
| 57 | .align-end { | ||
| 58 | align-items: flex-end; | ||
| 59 | } | ||
| 60 | |||
| 69 | .centered { | 61 | .centered { |
| 70 | align-items: center; | 62 | align-items: center; |
| 71 | justify-content: center; | 63 | justify-content: center; |
| @@ -80,6 +72,10 @@ footer { | |||
| 80 | justify-content: center; | 72 | justify-content: center; |
| 81 | } | 73 | } |
| 82 | 74 | ||
| 75 | .flex-end { | ||
| 76 | justify-content: flex-end; | ||
| 77 | } | ||
| 78 | |||
| 83 | .flex.footer-info { | 79 | .flex.footer-info { |
| 84 | gap: 1rem; | 80 | gap: 1rem; |
| 85 | } | 81 | } |
| @@ -92,26 +88,6 @@ footer { | |||
| 92 | position:relative; | 88 | position:relative; |
| 93 | } | 89 | } |
| 94 | 90 | ||
| 95 | .poweredby, | ||
| 96 | .copyright { | ||
| 97 | position: absolute; | ||
| 98 | left: 0; | ||
| 99 | width: 100%; | ||
| 100 | padding: 1rem; | ||
| 101 | text-align: center; | ||
| 102 | } | ||
| 103 | |||
| 104 | .poweredby { | ||
| 105 | background: #00000055; | ||
| 106 | bottom: 0; | ||
| 107 | padding: .5rem; | ||
| 108 | } | ||
| 109 | |||
| 110 | .copyright { | ||
| 111 | background: #00000022; | ||
| 112 | bottom: 50px; | ||
| 113 | } | ||
| 114 | |||
| 115 | .post { | 91 | .post { |
| 116 | margin-bottom: 1em; | 92 | margin-bottom: 1em; |
| 117 | } | 93 | } |
diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..c41540e --- /dev/null +++ b/config.toml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [params] | ||
| 2 | _merge = 'deep' | ||
| 3 | themeVersion = '0.1' | ||
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 065f708..7a26339 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html | |||
| @@ -1,26 +1,11 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | <h1>{{ .Title }}</h1> | 2 | <h1>{{ .Title | title }}</h1> |
| 3 | {{ if .Content }} | 3 | {{ if .Content }} |
| 4 | <p>{{ .Content }}</p> | 4 | <p>{{ .Content }}</p> |
| 5 | {{ end }} | 5 | {{ end }} |
| 6 | <section> | 6 | <section> |
| 7 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} | 7 | {{ range sort .Pages "Date" "desc" }} |
| 8 | <div>{{ .Render "summary" }}</div> | 8 | <div>{{ .Render "summary" }}</div> |
| 9 | {{ end }} | 9 | {{ end }} |
| 10 | {{ with .Paginator }} | ||
| 11 | <div class="grid"> | ||
| 12 | <div class='flex'> | ||
| 13 | {{ if .HasPrev }} | ||
| 14 | <a href="{{ .Prev.URL }}">prev</a> | ||
| 15 | {{ end }} | ||
| 16 | {{ if (or (.HasPrev) (.HasNext)) }} | ||
| 17 | <p>{{ .PageNumber }} of {{ .TotalPages }}</p> | ||
| 18 | {{ end }} | ||
| 19 | {{ if .HasNext }} | ||
| 20 | <a href="{{ .Next.URL }}">next</a> | ||
| 21 | {{ end }} | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | {{ end }} | ||
| 25 | </section> | 10 | </section> |
| 26 | {{ end }} | 11 | {{ end }} |
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 4512b16..48c7b97 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html | |||
| @@ -1,19 +1,17 @@ | |||
| 1 | <div class='post' style="margin-bottom: 2em;"> | 1 | <section> |
| 2 | <div> | 2 | <hgroup> |
| 3 | <h1 class="f3 near-black"> | 3 | <h3 class="f3 near-black"> |
| 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" }} | 7 | {{ if isset .Params "rating" }} |
| 8 | {{ .Params.rating }} | 8 | {{ .Params.rating }} |
| 9 | {{ end }} | 9 | {{ end }} |
| 10 | </h1> | 10 | </h3> |
| 11 | <p>{{ .Date | time.Format ":date_full" }}</p> | ||
| 11 | <p> | 12 | <p> |
| 12 | <span>{{ .WordCount }} words</span> | ||
| 13 | <span>{{ .ReadingTime }} min read</span> | 13 | <span>{{ .ReadingTime }} min read</span> |
| 14 | </p> | 14 | </p> |
| 15 | <p>Published: {{ .Date | time.Format ":date_full" }} | 15 | </hgroup> |
| 16 | </p> | 16 | <div>{{ .Summary | markdownify }}</div> |
| 17 | <div>{{ .Summary | markdownify }}</div> | 17 | </section> |
| 18 | </div> | ||
| 19 | </div> | ||
diff --git a/layouts/book/list.html b/layouts/book/list.html index 346a918..d1d1263 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html | |||
| @@ -1,33 +1,31 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | <article> | 2 | <h1>{{ .Title }}</h1> |
| 3 | <h1>{{ .Title }}</h1> | 3 | {{ if .Content }} |
| 4 | {{ if .Content }} | 4 | <p>{{- .Content -}}</p> |
| 5 | <p>{{- .Content -}}</p> | 5 | {{ end }} |
| 6 | {{ end }} | 6 | <section> |
| 7 | <section> | 7 | {{ if .IsSection }} |
| 8 | {{ if .IsSection }} | 8 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} |
| 9 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} | 9 | {{ if ne .Layout "list" }} |
| 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> | 10 | <div>{{ .Render "summary" }}</div> |
| 29 | {{ end }} | 11 | {{ end }} |
| 30 | {{ end }} | 12 | {{ end }} |
| 31 | </section> | 13 | {{ else }} |
| 32 | </article> | 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> | ||
| 33 | {{ end }} \ No newline at end of file | 31 | {{ 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 3800b98..171d3ba 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html | |||
| @@ -1,55 +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 | <div class="grid"> | 4 | <hgroup> |
| 5 | <div class="flex col"> | 5 | <h3>{{ .Site.Title | upper }}</h3> |
| 6 | <section> | 6 | <p>{{ .Site.Params.description }}</p> |
| 7 | <h4>Contact Info</h4> | 7 | <div> |
| 8 | <p>Phone: {{ .Site.Params.phone }}</p> | ||
| 9 | <p>Email: {{ .Site.Params.email }}</p> | ||
| 10 | </section> | ||
| 11 | <section> | ||
| 12 | <h4>Connect</h4> | 8 | <h4>Connect</h4> |
| 13 | <ul> | 9 | <ul> |
| 14 | {{ range $key, $value := .Site.Social }} | 10 | {{ range $key, $value := .Site.Social }} |
| 15 | <li> | 11 | <li> |
| 16 | {{ partial "social.html" (dict "social" $key "username" $value) }} | 12 | {{ partial "social.html" (dict "social" $key "username" $value) }} |
| 17 | </li> | 13 | </li> |
| 18 | {{ end }} | 14 | {{ end }} |
| 19 | </ul> | 15 | </ul> |
| 20 | </section> | 16 | </div> |
| 21 | </div> | 17 | </hgroup> |
| 22 | {{ with .Site.Params.friends }} | 18 | <div class="flex col align-end"> |
| 23 | <div class="friends-list"> | 19 | <h4>Get Around</h4> |
| 24 | <h3>Friends</h3> | ||
| 25 | <ul> | 20 | <ul> |
| 26 | {{ range . }} | 21 | {{ range .Site.Menus.main }} |
| 27 | <li> | 22 | <li><a href="{{ .URL }}">{{ .Name }}</a></li> |
| 28 | <a href="{{ .url }}" target="_blank"> | ||
| 29 | {{ if isset . "icon" }} | ||
| 30 | <img src="{{ .icon }}" alt="{{ .name }}" /> | ||
| 31 | {{ else }} | ||
| 32 | {{ .name }} | ||
| 33 | {{ end }} | ||
| 34 | </a> | ||
| 35 | </li> | ||
| 36 | {{ end }} | 23 | {{ end }} |
| 37 | </ul> | 24 | </ul> |
| 38 | </div> | 25 | </div> |
| 39 | {{ end }} | 26 | </div> |
| 40 | <section> | 27 | <div class="flex row space-between"> |
| 41 | <h4>Navigation</h4> | 28 | <div>Powered by <a href="https://gohugo.io">Hugo</a> & Blackbear (v{{.Site.Params.themeVersion }})</div> |
| 42 | <ul> | 29 | <div> |
| 43 | {{ range .Site.Menus.main }} | 30 | <span title="site version">v{{.Site.Params.siteVersion}}</span> |
| 44 | <li><a href="{{ .URL }}">{{ .Name }}</a></li> | ||
| 45 | {{ end }} | ||
| 46 | </ul> | ||
| 47 | </section> | ||
| 48 | </div> | 31 | </div> |
| 32 | <div>© Copyright {{ now.Format "2006" }} | All Rights Reserved</div> | ||
| 33 | </div> | ||
| 49 | </div> | 34 | </div> |
| 50 | <div class="poweredby"> | 35 | </footer> \ No newline at end of file |
| 51 | Powered by <a href="https://gohugo.io">Hugo</a> & Blackbear | ||
| 52 | </div> | ||
| 53 | <div class="copyright">© Copyright {{ now.Format "2006" }} | All Rights Reserved | ||
| 54 | </div> | ||
| 55 | </footer> | ||
diff --git a/layouts/post/single.html b/layouts/post/single.html index 166ecd6..25bfc23 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html | |||
| @@ -1,10 +1,13 @@ | |||
| 1 | {{ define "main" }} | 1 | {{ define "main" }} |
| 2 | {{ if not .Params.dontDisclaim }} | ||
| 3 | {{ partial "disclaimer" . }} | ||
| 4 | {{ end }} | ||
| 2 | <hgroup> | 5 | <hgroup> |
| 3 | <h1>{{ .Title }}</h1> | 6 | <h1>{{ .Title }}</h1> |
| 4 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | 7 | <h6>{{ .Date | time.Format ":date_full" }}</h6> |
| 8 | <h6>{{ .Lastmod | time.Format ":date_full" }}</h6> | ||
| 5 | </hgroup> | 9 | </hgroup> |
| 6 | <section class="content"> | 10 | <section class="content"> |
| 7 | {{- .Content -}} | 11 | {{- .Content -}} |
| 8 | </section> | 12 | </section> |
| 9 | </article> | ||
| 10 | {{ end }} | 13 | {{ end }} |
