Add photos section, allow disabling thumbs for galleries
This commit is contained in:
parent
443f279034
commit
9e38bb0f73
6 changed files with 41 additions and 4 deletions
BIN
assets/photos/20220519_0001.webp
Normal file
BIN
assets/photos/20220519_0001.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 186 KiB |
|
@ -1,3 +1,5 @@
|
|||
See my [gallery](/art)!
|
||||
|
||||
See my [photos](/photos)!
|
||||
|
||||
See my [about page](/about)!
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
title: "Art"
|
||||
layout: "gallery"
|
||||
json: "art"
|
||||
thumbnails: true
|
||||
---
|
||||
|
||||
Welcome to my gallery! I try to include some of my old art here as well, which I've kept since ~2016.
|
||||
|
|
8
content/photos/_index.md
Normal file
8
content/photos/_index.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
title: "Art"
|
||||
layout: "gallery"
|
||||
json: "photos"
|
||||
thumbnails: false
|
||||
---
|
||||
|
||||
{{< toc >}}
|
19
data/photos.json
Normal file
19
data/photos.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"categories": [
|
||||
{
|
||||
"name": "Figures",
|
||||
"description": "This is a photo collection of my figure collection.",
|
||||
"years": [
|
||||
{
|
||||
"year": 2022,
|
||||
"pieces": [
|
||||
{
|
||||
"title": "2B",
|
||||
"filename": "20220519_0001.webp"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,19 +1,25 @@
|
|||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
|
||||
{{ $art := site.Data.art }}
|
||||
{{ $art := (index site.Data ($.Param "json")) }}
|
||||
|
||||
{{ range $art.categories }}
|
||||
<h2>{{ .name }}</h2>
|
||||
<p>{{ .description }}</p>
|
||||
{{ range sort .years "year" "desc" }}
|
||||
<h3>{{ .year }}</h3>
|
||||
|
||||
{{ range .pieces }}
|
||||
<figure>
|
||||
{{ $thumb := resources.Get (printf "art-thumbs/%s" .filename) }}
|
||||
{{ $full := resources.Get (printf "art/%s" .filename) }}
|
||||
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
|
||||
|
||||
<a href="{{ $full.Permalink }}">
|
||||
<img width="128px" height="128px" src="{{ $thumb.Permalink }}"/>
|
||||
{{ if $.Params.thumbnails }}
|
||||
{{ $thumb := resources.Get (printf "%s-thumbs/%s" ($.Param "json") .filename) }}
|
||||
<img width="128px" height="128px" src="{{ $thumb.Permalink }}"/>
|
||||
{{ else }}
|
||||
<img src="{{ $full.Permalink }}"/>
|
||||
{{ end }}
|
||||
</a>
|
||||
|
||||
<figcaption>"{{ .title }}"</figcaption>
|
||||
|
|
Loading…
Add table
Reference in a new issue