Parameterize the photo grid

This commit is contained in:
Eryn Wells 2023-10-03 08:55:13 -07:00
parent 864c1b673a
commit 8cc207b84c
8 changed files with 30 additions and 10 deletions

View file

@ -1,3 +1,4 @@
{{ $gridSize := site.Params.photos.gridSize }}
:root { :root {
--date-item-background-color: rgb(var(--lt-gray)); --date-item-background-color: rgb(var(--lt-gray));
@ -26,7 +27,7 @@
.photos.list { .photos.list {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fill, minmax({{ printf "%dpx" $gridSize }}, 1fr));
gap: 4px; gap: 4px;
} }

View file

@ -1,2 +1 @@
@layer reset, typography, root, layout, section, page, utility; @layer reset, typography, root, layout, section, page, utility;

View file

@ -235,11 +235,12 @@
grid-column: wide-content-start / wide-content-end; grid-column: wide-content-start / wide-content-end;
} }
main > header > span.series { main > header > .series {
margin-inline-start: 0.5em; margin-inline-start: 0.5em;
width: 100%;
} }
main > header > span.series::before { main > header > .series::before {
margin-inline-end: 0.25em; margin-inline-end: 0.25em;
} }

View file

@ -167,6 +167,10 @@
line-height: var(--line-height); line-height: var(--line-height);
} }
p > code {
white-space: pre;
}
.social { .social {
letter-spacing: 2px; letter-spacing: 2px;
} }

View file

@ -4,3 +4,7 @@ twitter: erynofwales
github: erynofwales github: erynofwales
instagram: erynofwales instagram: erynofwales
description: Home page of Eryn Rachel Wells description: Home page of Eryn Rachel Wells
photos:
gridSize: 200
thumbnailSize: 600

View file

@ -1,5 +1,4 @@
{{ $stylesheets := slice (resources.Get "styles/root.css") {{ $stylesheets := slice (resources.Get "styles/railroad.css")
(resources.Get "styles/railroad.css")
(resources.Get "styles/monokai.css") (resources.Get "styles/monokai.css")
| append (resources.Match "styles/root/*.css" | sort) }} | append (resources.Match "styles/root/*.css" | sort) }}
{{ if not hugo.IsProduction }} {{ if not hugo.IsProduction }}

View file

@ -1,6 +1,13 @@
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 600 "Height" 600) -}} {{- $gridSize := $.Site.Params.photos.thumbnailSize -}}
{{- $thumbnail = $thumbnail.Crop "600x600" -}} {{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" $gridSize "Height" $gridSize) -}}
{{- $thumbnail = $thumbnail.Crop (printf "%dx%d" $gridSize $gridSize) -}}
{{- $altText := $thumbnail.Params.alt -}} {{- $altText := $thumbnail.Params.alt -}}
<a href="{{ .RelPermalink }}" title="{{ .Title }}"> <a href="{{ .RelPermalink }}" title="{{ .Title }}">
<img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}> <img
src="{{ $thumbnail.RelPermalink }}"
{{ with $altText }}
alt="{{ . }}"
{{ end }}
width={{ $gridSize }}
height={{ $gridSize }}>
</a> </a>

View file

@ -11,7 +11,12 @@
{{ if eq (len $photos) 1 }} {{ if eq (len $photos) 1 }}
{{- $img := index $photos 0 -}} {{- $img := index $photos 0 -}}
<figure> <figure>
<img src="{{ $img.RelPermalink }}"{{ with $img.Params.alt }} alt="{{ . }}"{{ end }}> <img
src="{{ $img.RelPermalink }}"
{{ with $img.Params.alt }}
alt="{{ . }}"
{{ end }}
height={{ $img.Height }}>
</figure> </figure>
<article> <article>