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 */
}
.brand {
.top-brand {
flex-grow: 1;
margin: 8px var(--page-margin);
font-size: 1.25em;
@@ -348,27 +348,27 @@ body {
align-items: center;
}
.brand a {
.top-brand > a {
color: inherit;
font-weight: bold;
}
.navbar {
.top-navbar {
display: flex;
flex-wrap: wrap;
}
.navbar-item {
.top-navbar-item {
padding: 12px var(--page-margin);
white-space: nowrap;
}
.navbar-item:hover {
.top-navbar-item:hover {
background-color: var(--background-2);
text-decoration: none;
}
.navbar-item.active {
.top-navbar-item--active {
font-weight: bold;
}
@@ -446,13 +446,6 @@ body {
/* List layout {{{ */
/* flexbox container for sections and main page list */
.list-page-container {
display: flex;
flex-direction: column;
gap: 40px;
}
.page-list {
display: flex;
flex-direction: column;
@@ -462,14 +455,14 @@ body {
margin-top: 16px;
}
.page-list > .page {
.summary {
padding: 24px;
border-radius: 12px;
background-color: var(--background-1);
color: var(--text-1);
}
.page > .page-title {
.summary-title {
margin-top: 0;
}
@@ -481,18 +474,29 @@ body {
}
*/
.page-title {
.page-title,
.summary-title {
margin-bottom: 10px;
}
.page-title a {
.page-title a,
.summary-title a {
color: inherit;
}
.page-title h1 {
.page-title h1,
.summary-title h1 {
margin: 0;
}
.summary-description {
margin-top: 10px;
}
.summary-readmore {
margin-top: 5px;
}
.page-metadata {
margin-bottom: 24px;
}
@@ -518,14 +522,6 @@ body {
margin-top: 15px;
}
.page-description {
margin-top: 10px;
}
.readmore {
margin-top: 5px;
}
/* }}} */
/* Taxonomy list layout {{{ */
@@ -578,17 +574,7 @@ body {
/* Series list layout {{{ */
.page-list.series {
display: flex;
gap: 80px;
flex-flow: row wrap;
list-style: none;
color: var(--text-0);
padding: 8px;
border-radius: 16px;
}
.page-list.series-inner {
.page-list-series-inner {
gap: 10px;
flex-direction: row;
flex-flow: row wrap;
@@ -597,7 +583,7 @@ body {
padding: 8px;
border-radius: 16px;
}
.page-list.series-inner > .page {
.page-list-series-inner > .summary {
flex: 1;
min-width: 49%;
}
@@ -607,6 +593,7 @@ body {
/* Subsections on list pages {{{ */
.sections {
margin-bottom: 60px;
display: flex;
flex-direction: column;
gap: 10px;
@@ -617,6 +604,9 @@ body {
color: var(--text-1);
border-radius: 12px;
padding: 1px 25px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.section:hover {
@@ -640,6 +630,16 @@ body {
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">
{{ with . }}
{{ $list := dict }}
{{ $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 . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}
<div>

View File

@@ -1,13 +1,13 @@
<header class="top">
<div class="brand">
<div class="top-brand">
<a href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }}
</a>
</div>
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">
<nav class="top-navbar" aria-label="{{ i18n "aria_navbar" }}">
{{ 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 }}
{{ range .Site.Menus.main }}
@@ -16,7 +16,7 @@
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
{{ $isActive = true }}
{{ 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 }}
href="{{ .URL }}">{{ .Name }}</a>
{{ end }}

View File

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

View File

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

View File

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

View File

@@ -9,7 +9,6 @@
{{ . }}
{{ end }}
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
@@ -19,7 +18,6 @@
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }}
{{ end }}

View File

@@ -1,5 +1,6 @@
<a class="section-anchor" href="{{ .Permalink }}">
<div class="section">
<div>
<h2 class="section-title">
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
@@ -11,4 +12,9 @@
</div>
{{ end }}
</div>
<div class="section-arrow">
{{ partial "icon.html" "arrow-right" }}
</div>
</div>
</a>

View File

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