aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-09-06 21:44:11 +0200
committerOscar Najera <hi@oscarnajera.com>2023-09-06 21:44:11 +0200
commit4cf3f2e6297878a4a6303a886e24addd5cf4580f (patch)
tree193599c81185bda2876a9a9826e7ec4c4499e994
parent4aaada38d09811b6ee6a34f55b3a44514efa2aad (diff)
downloadhugo-minimalist-theme-4cf3f2e6297878a4a6303a886e24addd5cf4580f.tar.gz
hugo-minimalist-theme-4cf3f2e6297878a4a6303a886e24addd5cf4580f.tar.bz2
hugo-minimalist-theme-4cf3f2e6297878a4a6303a886e24addd5cf4580f.zip
Simplify and consolidate page styles
Use the section template instead of defining a new page type for the about page. In general I could build on pieces of markdown for each subsection.
-rw-r--r--layouts/404.html14
-rw-r--r--layouts/_default/about.html12
-rw-r--r--layouts/_default/baseof.html3
-rw-r--r--layouts/_default/list.html8
-rw-r--r--layouts/_default/single.html11
-rw-r--r--layouts/index.html7
-rw-r--r--layouts/partials/header.html2
-rw-r--r--layouts/partials/open_section.html5
-rw-r--r--layouts/section_page/single.html10
9 files changed, 29 insertions, 43 deletions
diff --git a/layouts/404.html b/layouts/404.html
index 754d082..46f4883 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,12 +1,8 @@
-{{ define "main"}}
-<div class="mw7 center avenir ph2">
-
- <h1> Page not found</h1>
-
- {{/* Suggest recently published pages to the user. */}}
-
- <p>Perhaps you were looking for one of these?</p>
+{{ define "hero" }}
+{{ partial "hero.html" (dict "Title" .Title "Content" "Perhaps you were looking for one of these?") }}
+{{ end }}
+{{ define "main"}}
{{ $query := where (where (where (where site.RegularPages.ByDate.Reverse "Title" "!=" "") "Kind" "in" (slice "page" "section")) "Params.private" "!=" true) "Permalink" "!=" "" }}
{{ $count := len $query }}
{{ if gt $count 0 }}
@@ -15,6 +11,4 @@
{{ end }}
{{ end }}
-</div>
-
{{ end }}
diff --git a/layouts/_default/about.html b/layouts/_default/about.html
new file mode 100644
index 0000000..6fdfaba
--- /dev/null
+++ b/layouts/_default/about.html
@@ -0,0 +1,12 @@
+{{ define "hero" }}
+{{ partial "hero.html" . }}
+{{ end }}
+
+{{ define "main" }}
+{{ range .Paginator.Pages }}
+<div class="main-content lh-copy f5 f4-ns">
+{{ .Content }}
+</div>
+{{ end }}
+
+{{ end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 81ba4d7..b0a5999 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -3,7 +3,8 @@
{{- partial "head.html" . -}}
<body class="w3-theme-light">
{{- partial "header.html" . -}}
- <div id="content" class="min-vh-100">
+ {{ block "hero" . }} {{ end }}
+ <div id="content" class="min-vh-100 mw7 center avenir ph2">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 8737066..f8b838d 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,10 +1,10 @@
-{{ define "main" }}
-<div class="mw7 center avenir ph2">
-{{ partial "open_section.html" . }}
+{{ define "hero" }}
+{{ partial "hero.html" . }}
+{{ end }}
+{{ define "main" }}
{{ range .Paginator.Pages.ByPublishDate.Reverse }}
{{ partial "post.html" . }}
{{ end }}
{{ partial "pagination.html" . }}
-</div>
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 894caf5..d12dd07 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,5 +1,4 @@
{{ define "main" }}
-<article class="mw7 center avenir ph2">
<header>
<h2 class="baskerville f2 lh-title mv3">
{{ .Title }}
@@ -25,15 +24,11 @@
{{ if isset .Params "metadata" }}
{{ partial "metadata.html" . }}
{{ end }}
-
-
</header>
-
- <div class="main-content sans-serif f5 f4-ns lh-copy baskerville">
+<div class="main-content lh-copy f5 f4-ns">
{{ .Content }}
- </div>
-</article>
-<div class="sans-serif f5 f4-ns lh-copy pv2">
+</div>
+<div class="f5 f4-ns lh-copy pv2">
{{ if isset .Params "metadata" }}
{{ partial "author_card" . }}
{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index a21b7c4..889d236 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,10 +1,10 @@
-{{ define "main" }}
+{{ define "hero" }}
{{ partial "hero.html" . }}
+{{ end }}
+{{ define "main" }}
<!-- Page Content -->
{{ range $index, $element := where .Pages "Type" "in" .Site.Params.mainSections }}
-<div class="mw7 center avenir ph2">
-{{ partial "open_section.html" . }}
{{ range first .Params.index_show .Pages.ByPublishDate.Reverse }}
{{ partial "post.html" . }}
{{ end }}
@@ -13,6 +13,5 @@
<i class="fas fa-angle-right"></i>
<a href="{{ .Type }}" class="f3 link near-black">See all</a>
</div>
-</div>
{{ end }}
{{ end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 0778292..c0418b2 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -14,7 +14,7 @@
<label class="fr dn-ns ma2 pa3 menu-icon" for="menu-btn">
<span class="navicon bg-near-white"></span>
</label>
- <ul class="ma0 pa0 list overflow-hidden sans-serif">
+ <ul class="ma0 pa0 list overflow-hidden avenir">
{{ range .Site.Menus.main }}
<li class="fl-ns w3-hover-theme">
<a class="db f6 pa3 link near-white"
diff --git a/layouts/partials/open_section.html b/layouts/partials/open_section.html
deleted file mode 100644
index cf59ee8..0000000
--- a/layouts/partials/open_section.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<h2 class="baskerville f2 lh-title">{{ .Title }}</h2>
-
-<div class="main-content lh-copy">
- {{ .Content }}
-</div>
diff --git a/layouts/section_page/single.html b/layouts/section_page/single.html
deleted file mode 100644
index 162b4b7..0000000
--- a/layouts/section_page/single.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ define "main" }}
-{{ partial "hero.html" . }}
-
-<div class="mw7 center avenir ph2">
-{{ range .Resources.ByType "page" }}
-{{ partial "open_section.html" . }}
-{{ end }}
-</div>
-
-{{ end }}