Add more links, changes

This commit is contained in:
Joshua Goins 2024-02-19 15:29:36 -05:00
parent e66df967a4
commit 8326ba2b2e
5 changed files with 47 additions and 42 deletions

View file

@ -1,5 +1,6 @@
{ {
"changes": [ "changes": [
"2024-02-19: Further site improvements, started a FFXIV shrine.",
"2024-01-27: Added new artwork!", "2024-01-27: Added new artwork!",
"2023-09-24: Added new Sakura artwork, changed profile pic.", "2023-09-24: Added new Sakura artwork, changed profile pic.",
"2023-09-21: Added some more art to the gallery!", "2023-09-21: Added some more art to the gallery!",

View file

@ -271,11 +271,10 @@ figure figcaption {
} }
.gallery-con { .gallery-con {
display: flex;
flex-wrap: wrap;
border: 1px dashed gray; border: 1px dashed gray;
border-radius: 5px; border-radius: 5px;
background-color: var(--background-tertiary); background-color: var(--background-tertiary);
padding: 20px;
} }
.generic-con { .generic-con {

View file

@ -1,52 +1,55 @@
<div class="gallery-con"> <div class="gallery-con">
{{ with .Site.GetPage "/art" }} <div style="display: flex; flex-wrap: wrap;">
{{ range .Param "featured" }} {{ with .Site.GetPage "/art" }}
<figure class="gallery-fig"> {{ range .Param "featured" }}
{{ $filename_without_ext := strings.TrimSuffix (path.Ext .filename) .filename }} <figure class="gallery-fig">
{{ $filename_without_ext := strings.TrimSuffix (path.Ext .filename) .filename }}
{{ $month := "1" }} {{ $month := "1" }}
{{ $year := "1" }} {{ $year := "1" }}
{{ if .date }} {{ if .date }}
{{ $split := split .date "-" }} {{ $split := split .date "-" }}
{{ $month = index $split 1 }} {{ $month = index $split 1 }}
{{ $year = index $split 0 }} {{ $year = index $split 0 }}
{{ end }} {{ end }}
{{ $use_newformat := false }} {{ $use_newformat := false }}
{{ if ge (int $year) 2023 }} {{ if ge (int $year) 2023 }}
{{ $use_newformat = true }} {{ $use_newformat = true }}
{{ end }} {{ end }}
{{ $path := printf "/art/%s/%s/%s" $year $month $filename_without_ext}} {{ $path := printf "/art/%s/%s/%s" $year $month $filename_without_ext}}
<a href="{{ $path }}" aria-label="Click to view details {{ $year }}" class="no-decoration"> <a href="{{ $path }}" aria-label="Click to view details {{ $year }}" class="no-decoration">
{{ $title := .title }} {{ $title := .title }}
{{ if $use_newformat }} {{ if $use_newformat }}
{{ $full := printf "https://images.redstrate.com/thumb/%s.avif" $filename_without_ext }} {{ $full := printf "https://images.redstrate.com/thumb/%s.avif" $filename_without_ext }}
{{ $jpeg := printf "https://images.redstrate.com/thumb/%s.jpg" $filename_without_ext }} {{ $jpeg := printf "https://images.redstrate.com/thumb/%s.jpg" $filename_without_ext }}
<picture> <picture>
<source srcset="{{ $full }}" type="image/avif"/> <source srcset="{{ $full }}" type="image/avif"/>
<img class="gallery-img featured-art" alt="{{ $title }}" src="{{ $jpeg }}"> <img class="gallery-img featured-art" alt="{{ $title }}" src="{{ $jpeg }}">
</picture> </picture>
{{ else }}
{{ with resources.Get (printf "art/%s" .filename) }}
{{ $image := .Resize "500x" }}
<img class="gallery-img featured-art" alt="{{ $title }}" width="{{ $image.Width }}" height="{{ $image.Height }}" src="{{ $image.RelPermalink }}">
{{ else }} {{ else }}
<p>Thumbnail not found!</p> {{ with resources.Get (printf "art/%s" .filename) }}
{{ $image := .Resize "500x" }}
<img class="gallery-img featured-art" alt="{{ $title }}" width="{{ $image.Width }}" height="{{ $image.Height }}" src="{{ $image.RelPermalink }}">
{{ else }}
<p>Thumbnail not found!</p>
{{ end }}
{{ end }} {{ end }}
{{ end }} </a>
</a>
<figcaption> <figcaption>
{{ with .title }} {{ with .title }}
<i>"{{ . }}"</i> <i>"{{ . }}"</i>
{{ end }} {{ end }}
</figcaption> </figcaption>
</figure> </figure>
{{ end }}
{{ end }} {{ end }}
{{ end }} </div>
<a href="/art">View all art</a>
</div> </div>

View file

@ -1,7 +1,7 @@
<div class="generic-con"> <div class="generic-con">
<ul style="padding: 0"> <ul style="padding: 0">
{{ $changes := (index site.Data "recent-changes") }} {{ $changes := (index site.Data "recent-changes") }}
{{ range $changes.changes }} {{ range $changes.changes | last 5 }}
<li style="margin-left: 10px; list-style-type: square;"> <li style="margin-left: 10px; list-style-type: square;">
<p>{{ . }}</p> <p>{{ . }}</p>
</li> </li>

View file

@ -7,4 +7,6 @@
</li> </li>
{{ end }} {{ end }}
</ul> </ul>
<a href="/blog">View all blog posts</a>
</div> </div>