8 Commits

Author SHA1 Message Date
1f4a06569d WIP? add optional dict to page-list 2025-08-31 03:14:35 -05:00
5590019c74 WIP 2025-08-31 03:10:01 -05:00
90ead0daea WIP 2025-08-31 03:09:37 -05:00
37dbdc53af Use section tag for homepage latest posts section
This improves semantic HTML compliance.
2025-08-30 22:25:05 -05:00
ef91527ed6 Remove leftover additional-head partial
This was removed from use in d50a4dc6bd,
but the actual file was left in on accident.
2025-08-30 22:00:09 -05:00
4bc8184593 Add arrow in the right side of list page section buttons
This makes it more obvious that you can click this to view a different
area.
2025-08-27 11:38:29 -05:00
22e7ad4b77 Remove nested list-page-container to simplify layout CSS on section page
Originally I was using gap on a flexbox to separate the .sections
container from the rest of the page list. But it's simpler if I just use
block layout and a bottom margin, then I don't need an extra layer of
div.
2025-08-27 11:13:48 -05:00
c2b10a6c99 Use hierarchical naming on top and its elements
Any element that can't stand on its own as a self-contained component
should have its naming nested under whatever parent it's supposed to
have.

Fixes #109
2025-08-27 10:50:52 -05:00
11 changed files with 130 additions and 131 deletions

View File

@@ -340,7 +340,7 @@ body {
* or it will need its hover background to be chopped off on the left */ * or it will need its hover background to be chopped off on the left */
} }
.brand { .top-brand {
flex-grow: 1; flex-grow: 1;
margin: 8px var(--page-margin); margin: 8px var(--page-margin);
font-size: 1.25em; font-size: 1.25em;
@@ -348,27 +348,27 @@ body {
align-items: center; align-items: center;
} }
.brand a { .top-brand > a {
color: inherit; color: inherit;
font-weight: bold; font-weight: bold;
} }
.navbar { .top-navbar {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.navbar-item { .top-navbar-item {
padding: 12px var(--page-margin); padding: 12px var(--page-margin);
white-space: nowrap; white-space: nowrap;
} }
.navbar-item:hover { .top-navbar-item:hover {
background-color: var(--background-2); background-color: var(--background-2);
text-decoration: none; text-decoration: none;
} }
.navbar-item.active { .top-navbar-item--active {
font-weight: bold; font-weight: bold;
} }
@@ -446,13 +446,6 @@ body {
/* List layout {{{ */ /* List layout {{{ */
/* flexbox container for sections and main page list */
.list-page-container {
display: flex;
flex-direction: column;
gap: 40px;
}
.page-list { .page-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -462,14 +455,14 @@ body {
margin-top: 16px; margin-top: 16px;
} }
.page-list > .page { .summary {
padding: 24px; padding: 24px;
border-radius: 12px; border-radius: 12px;
background-color: var(--background-1); background-color: var(--background-1);
color: var(--text-1); color: var(--text-1);
} }
.page > .page-title { .summary-title {
margin-top: 0; margin-top: 0;
} }
@@ -481,18 +474,29 @@ body {
} }
*/ */
.page-title { .page-title,
.summary-title {
margin-bottom: 10px; margin-bottom: 10px;
} }
.page-title a { .page-title a,
.summary-title a {
color: inherit; color: inherit;
} }
.page-title h1 { .page-title h1,
.summary-title h1 {
margin: 0; margin: 0;
} }
.summary-description {
margin-top: 10px;
}
.summary-readmore {
margin-top: 5px;
}
.page-metadata { .page-metadata {
margin-bottom: 24px; margin-bottom: 24px;
} }
@@ -518,14 +522,6 @@ body {
margin-top: 15px; margin-top: 15px;
} }
.page-description {
margin-top: 10px;
}
.readmore {
margin-top: 5px;
}
/* }}} */ /* }}} */
/* Taxonomy list layout {{{ */ /* Taxonomy list layout {{{ */
@@ -578,17 +574,7 @@ body {
/* Series list layout {{{ */ /* Series list layout {{{ */
.page-list.series { .page-list-series-inner {
display: flex;
gap: 80px;
flex-flow: row wrap;
list-style: none;
color: var(--text-0);
padding: 8px;
border-radius: 16px;
}
.page-list.series-inner {
gap: 10px; gap: 10px;
flex-direction: row; flex-direction: row;
flex-flow: row wrap; flex-flow: row wrap;
@@ -597,7 +583,7 @@ body {
padding: 8px; padding: 8px;
border-radius: 16px; border-radius: 16px;
} }
.page-list.series-inner > .page { .page-list-series-inner > .summary {
flex: 1; flex: 1;
min-width: 49%; min-width: 49%;
} }
@@ -607,6 +593,7 @@ body {
/* Subsections on list pages {{{ */ /* Subsections on list pages {{{ */
.sections { .sections {
margin-bottom: 60px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
@@ -617,6 +604,9 @@ body {
color: var(--text-1); color: var(--text-1);
border-radius: 12px; border-radius: 12px;
padding: 1px 25px; padding: 1px 25px;
display: flex;
flex-direction: row;
justify-content: space-between;
} }
.section:hover { .section:hover {
@@ -640,6 +630,16 @@ body {
margin-bottom: 5px; margin-bottom: 5px;
} }
.section-arrow {
margin-block: auto;
max-height: fit-content;
float: right;
}
.section-arrow > .icon {
height: 48px;
width: 48px;
}
/* }}} */ /* }}} */

View File

@@ -1,4 +0,0 @@
{{/*
Create a file named `layouts/partials/additional-head.html` at your site root to
add extra tags into <head>. Page variables are passed.
*/}}

View File

@@ -1,9 +1,18 @@
<div class="page-list"> {{ $list := dict }}
{{ with . }} {{ $extraclasses := "" }}
{{ with try (index . "list") }}
{{ if .Err }}
{{ $list = $ }}
{{ else }}
{{ $list = .Value }}
{{ $extraclasses = index $ "classes" }}
{{ end }}
{{ end }}
<div class="page-list{{ with $extraclasses }}{{ . }}{{ end }}">
{{ with $list }}
{{ range . }} {{ range . }}
<article class="page"> {{ .Render "summary" }}
{{ .Render "summary" }}
</article>
{{ end }} {{ end }}
{{ else }} {{ else }}
<div> <div>

View File

@@ -1,13 +1,13 @@
<header class="top"> <header class="top">
<div class="brand"> <div class="top-brand">
<a href="{{ .Site.Home.Permalink | absLangURL }}"> <a href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }} {{ .Site.Title | markdownify }}
</a> </a>
</div> </div>
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}"> <nav class="top-navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ with .Site.Home }} {{ with .Site.Home }}
<a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a> <a class="top-navbar-item{{ if $.IsHome }} top-navbar-item--active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
{{ end }} {{ end }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
@@ -16,7 +16,7 @@
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }} {{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
{{ $isActive = true }} {{ $isActive = true }}
{{ end }} {{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}" <a class="top-navbar-item{{ if $isActive }} top-navbar-item--active{{ end }}"
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }} {{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
href="{{ .URL }}">{{ .Name }}</a> href="{{ .URL }}">{{ .Name }}</a>
{{ end }} {{ end }}

View File

@@ -1,16 +1,18 @@
<h2 class="page-title"> <article class="summary">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <h2 class="summary-title">
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/author.html" . }} {{ partial "page-metadata/author.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="summary-description">
{{ . }} {{ . }}
</div>
{{ end }}
<div class="summary-readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
{{ end }} </article>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@@ -8,17 +8,5 @@
{{ . }} {{ . }}
{{ end }} {{ end }}
<div class="page-list"> {{ partial "page-list.html" .Paginator.Pages }}
{{ with .Paginator.Pages }}
{{ range . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }} {{ end }}

View File

@@ -7,7 +7,7 @@
{{ if .Site.Params.homepageLatestPosts }} {{ if .Site.Params.homepageLatestPosts }}
<hr> <hr>
<div class="homepage-latest-posts"> <section class="homepage-latest-posts">
<h1> <h1>
{{ i18n "latest_posts" }} {{ i18n "latest_posts" }}
{{ partial "rss-link.html" . }} {{ partial "rss-link.html" . }}
@@ -16,6 +16,6 @@
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }} {{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
</div> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@@ -9,17 +9,15 @@
{{ . }} {{ . }}
{{ end }} {{ end }}
<div class="list-page-container"> {{ with .Sections }}
{{ with .Sections }} <div class="sections">
<div class="sections"> {{ range . }}
{{ range . }} {{ .Render "summary" }}
{{ .Render "summary" }} {{ end }}
{{ end }} </div>
</div> {{ end }}
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }} {{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ end }} {{ end }}

View File

@@ -1,14 +1,20 @@
<a class="section-anchor" href="{{ .Permalink }}"> <a class="section-anchor" href="{{ .Permalink }}">
<div class="section"> <div class="section">
<h2 class="section-title"> <div>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }} <h2 class="section-title">
{{ .Title | markdownify }} {{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
</h2> {{ .Title | markdownify }}
</h2>
{{ with .Summary }} {{ with .Summary }}
<div class="section-description"> <div class="section-description">
{{ . }} {{ . }}
</div> </div>
{{ end }} {{ end }}
</div>
<div class="section-arrow">
{{ partial "icon.html" "arrow-right" }}
</div>
</div> </div>
</a> </a>

View File

@@ -1,21 +1,19 @@
<h2 class="page-title"> <article class="summary">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} <h2 class="summary-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/series.html" . }} {{ partial "page-metadata/series.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="summary-description">
{{ . }} {{ . }}
</div> </div>
{{ end }}
<div class="page-list series-inner">
{{ range .Data.Pages.Reverse }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }} {{ end }}
</div>
<div class="page-list page-list-series-inner">
{{ partial "page-list.html" .Data.Pages.Reverse }}
</div>
</article>

View File

@@ -1,19 +1,21 @@
<h2 class="page-title"> <article class="summary">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} <h2 class="summary-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/post-short.html" . }} {{ partial "page-metadata/post-short.html" . }}
{{ partial "feature-figure.html" . }} {{ partial "feature-figure.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="summary-description">
{{ . }} {{ . }}
</div>
{{ end }}
<div class="summary-readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
{{ end }} </article>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>