Consolidate list template
Rearrange styles and templates to use the list partial templates in termlite.
This commit is contained in:
parent
4cb92ab5a9
commit
9620d4e8b5
3 changed files with 17 additions and 61 deletions
|
@ -79,8 +79,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.photostream-grid {
|
|
||||||
grid-column: full-start / full-end;
|
.main--photostream .main__posts-by-year {
|
||||||
|
grid-column: main-start / main-end;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||||
|
|
||||||
|
@ -88,24 +89,8 @@
|
||||||
margin-block-end: var(--space-l);
|
margin-block-end: var(--space-l);
|
||||||
}
|
}
|
||||||
|
|
||||||
> .photostream-grid__date-heading {
|
.main__section-heading {
|
||||||
align-items: center;
|
grid-column: 1 / -1;
|
||||||
background-color: var(--gray6);
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
line-height: 1;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
> h2 {
|
|
||||||
font-size: var(--text-xxl);
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
color: var(--text-color-secondary);
|
|
||||||
content: ">";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,43 +1,7 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main class="main--list main--photostream">
|
{{ if eq . .FirstSection }}
|
||||||
<header class="page-header">
|
{{ partial "page/first_section.list.html" (dict "page" . "class" "main--photostream") }}
|
||||||
{{ partial "page_header.html" (dict "page" .) }}
|
{{ else }}
|
||||||
</header>
|
{{ partial "page/descendent_section.list.html" (dict "page" . "class" "main--photostream") }}
|
||||||
|
{{ end }}
|
||||||
{{/* Each page is a year section. */}}
|
|
||||||
{{- $yearPages := .Pages.ByPublishDate.Reverse -}}
|
|
||||||
{{- $yearLimit := math.Max ($.Site.Params.blog.yearLimit | default 5) 1 -}}
|
|
||||||
{{- $expandedYears := first $yearLimit $yearPages -}}
|
|
||||||
{{- $collapsedYears := after $yearLimit $yearPages -}}
|
|
||||||
|
|
||||||
{{-
|
|
||||||
partial "page/section_year_nav.html"
|
|
||||||
(dict
|
|
||||||
"years" $expandedYears
|
|
||||||
"includeCollapsedYearItem" (gt (len $collapsedYears) 0)
|
|
||||||
)
|
|
||||||
-}}
|
|
||||||
|
|
||||||
{{- .Content -}}
|
|
||||||
|
|
||||||
{{ range $expandedYears }}
|
|
||||||
<section class="photostream-grid">
|
|
||||||
<header id="{{ .Date | time.Format "2006" }}" class="photostream-grid__date-heading">
|
|
||||||
<h2><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></h2>
|
|
||||||
</header>
|
|
||||||
{{ range .RegularPagesRecursive.ByPublishDate.Reverse -}}
|
|
||||||
{{ .Render "page_summary" }}
|
|
||||||
{{ end }}
|
|
||||||
</section>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ with $collapsedYears -}}
|
|
||||||
<h2 id="older">{{ i18n "olderPagesSectionTitle" }}</h2>
|
|
||||||
<ul>
|
|
||||||
{{ range . -}}
|
|
||||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle | markdownify }}</a></li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
{{ end }}
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
{{- $gridSize := $.Site.Params.photos.thumbnailSize -}}
|
{{- $gridSize := $.Site.Params.photos.thumbnailSize -}}
|
||||||
|
|
||||||
{{- $thumbnail := partial "photostream/thumbnail.html" (dict "Page" . "Width" $gridSize "Height" $gridSize) -}}
|
{{- $thumbnail := partial "photostream/thumbnail.html" (dict "Page" . "Width" $gridSize "Height" $gridSize) -}}
|
||||||
{{- $thumbnail = $thumbnail.Crop (printf "%dx%d" $gridSize $gridSize) -}}
|
{{- $thumbnail = $thumbnail.Crop (printf "%dx%d" $gridSize $gridSize) -}}
|
||||||
|
|
||||||
{{- $altText := $thumbnail.Params.alt -}}
|
{{- $altText := $thumbnail.Params.alt -}}
|
||||||
|
|
||||||
{{- $linkTitle := .LinkTitle | markdownify -}}
|
{{- $linkTitle := .LinkTitle | markdownify -}}
|
||||||
{{- $showsTitle := le (len $linkTitle) 18 -}}
|
{{- $showsTitle := le (len $linkTitle) 18 -}}
|
||||||
|
{{- if not $showsTitle -}}
|
||||||
|
{{ warnf "Title for photostream item is too long for grid: %s" .Permalink }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
<article class="photostream-item">
|
<article class="photostream-item">
|
||||||
{{ if $showsTitle }}
|
{{ if $showsTitle }}
|
||||||
<h3 class="photostream-item__title">{{ $linkTitle }}</h3>
|
<h3 class="photostream-item__title">{{ $linkTitle }}</h3>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue