Add wallpapers page
This commit is contained in:
parent
0991756630
commit
42a9fa056d
3 changed files with 88 additions and 0 deletions
6
content/art/wallpapers/_index.md
Normal file
6
content/art/wallpapers/_index.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: "Wallpapers"
|
||||||
|
layout: "wallpaper"
|
||||||
|
---
|
||||||
|
|
||||||
|
Here's a selection of my artwork as uncompressed PNG (ideal for wallpapers), instead of the 1920 x 1080 compressed versions you'll find elsewhere:
|
29
data/wallpapers.json
Normal file
29
data/wallpapers.json
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"wallpapers": [
|
||||||
|
{
|
||||||
|
"art": "another-thursday",
|
||||||
|
"resolution": "3840 x 2160",
|
||||||
|
"size": "6.5 MiB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"art": "bringontheketchup",
|
||||||
|
"resolution": "3840 x 2160",
|
||||||
|
"size": "4.4 MiB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"art": "moonlight",
|
||||||
|
"resolution": "3840 x 2160",
|
||||||
|
"size": "5.5 MiB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"art": "orbit-correction",
|
||||||
|
"resolution": "3840 x 2160",
|
||||||
|
"size": "4.2 MiB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"art": "mythra",
|
||||||
|
"resolution": "3840 x 2160",
|
||||||
|
"size": "4.8 MiB"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
53
themes/red/layouts/_default/wallpaper.html
Normal file
53
themes/red/layouts/_default/wallpaper.html
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{{/* Page layout used for art wallpapers page. */}}
|
||||||
|
|
||||||
|
{{ define "main" }}
|
||||||
|
<h2>{{ .Title }}</h2>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
{{ .Content }}
|
||||||
|
|
||||||
|
{{ $art := $.GetPage "/art" }}
|
||||||
|
|
||||||
|
{{ $wallpapers := index .Site.Data "wallpapers" }}
|
||||||
|
{{ range $wallpapers.wallpapers }}
|
||||||
|
{{ with $art.GetPage .art }}
|
||||||
|
|
||||||
|
{{ $month := "1" }}
|
||||||
|
{{ $year := "1" }}
|
||||||
|
|
||||||
|
{{ if .Date }}
|
||||||
|
{{ $split := split .Date "-" }}
|
||||||
|
{{ $month = index $split 1 }}
|
||||||
|
{{ $year = index $split 0 }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<h2 style="text-align: center">{{ .Title }} ({{ $year }})</h2>
|
||||||
|
<figure class="gallery-fig">
|
||||||
|
{{ $filename_without_ext := .Params.slug }}
|
||||||
|
|
||||||
|
{{ $path := printf "/art/%s/%s/%s" $year $month $filename_without_ext}}
|
||||||
|
|
||||||
|
<a href="{{ $path }}" aria-label="Click to view details {{ $year }}" class="no-decoration">
|
||||||
|
{{ $title := .Title }}
|
||||||
|
|
||||||
|
{{ $full := printf "https://images.redstrate.com/thumb/%s.avif" $filename_without_ext }}
|
||||||
|
{{ $jpeg := printf "https://images.redstrate.com/thumb/%s.jpg" $filename_without_ext }}
|
||||||
|
|
||||||
|
<picture>
|
||||||
|
<source srcset="{{ $full }}" type="image/avif"/>
|
||||||
|
<img class="gallery-img featured-art" alt="{{ $title }}" src="{{ $jpeg }}">
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<figcaption>
|
||||||
|
{{ with .Title }}
|
||||||
|
<span>Preview</span>
|
||||||
|
{{ end }}
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
{{ end }}
|
||||||
|
<p style="text-align: center">{{ .resolution }}</p>
|
||||||
|
<p style="text-align: center"><a href="https://images.redstrate.com/wallpapers/{{ .art }}.png">Download PNG ({{ .size }})</a></p>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
Loading…
Add table
Reference in a new issue