More filtering improvements

This commit is contained in:
Joshua Goins 2024-10-17 00:08:00 -04:00
parent 83fbdc3ae9
commit aa6fb29f43
6 changed files with 17 additions and 7 deletions

View file

@ -8,4 +8,4 @@ The gallery is sorted by date, but there's other sections to check out such as [
I've also been [participating in Artfight](https://artfight.net/~redstrate) since 2023. You can view my attacks and defenses [here](/art/tags/artfight).
You can follow me on [Mastodon](https://mastodon.art/@redstrate), [Pixiv](https://www.pixiv.net/en/users/58118005), [RSS](/art/index.xml)!
You can follow me on [Mastodon](https://mastodon.art/@redstrate), [Pixiv](https://www.pixiv.net/en/users/58118005), [RSS](/art/index.xml)! The RSS feed is a combination of the "Original" and "Fanart" categories.

View file

@ -1,6 +1,6 @@
{
"date": "2011-12-06",
"title": "Turrets",
"tags": ["Animation", "Flipnote"],
"tags": ["Animation", "Flipnote", "fan art"],
"type": "Animation"
}

View file

@ -9,7 +9,7 @@
<div class="art-inner">
{{ $alertimg := resources.Get "alert.png" }}
{{ with $.Params.new_banner }}
<div class="new-banner"><img alt="Alert Icon" width="16" height="16" class="banner-alert-icon" src="{{ $alertimg.RelPermalink }}"><b>{{ . }}</b><img alt="Alert Icon" width="16" height="16" class="banner-alert-icon" src="{{ $alertimg.RelPermalink }}"></div>
<div class="new-banner"><img alt="Alert Icon" width="16" height="16" class="banner-alert-icon" src="{{ $alertimg.RelPermalink }}"><b>{{ . }}</b><img alt="Alert Icon" width="16" height="16" class="banner-alert-icon" src="{{ $alertimg.RelPermalink }}"></div>
{{ end }}
{{ .Content }}
@ -29,6 +29,7 @@
<a class="art-button" href="/art/tags/fan-art/">Fanart</a><br>
<a class="art-button" href="/art/nsfw">NSFW</a><br>
<a class="art-button" href="/art/guest">Guest</a><br>
<a class="art-button" href="/art/wallpapers">Wallpapers</a><br>
<a class="art-button" href="/art/characters">Characters</a>
{{ partial "art-years" . }}

View file

@ -1,7 +1,12 @@
{{ define "main" }}
<h2>{{ .Title }}</h2>
<hr>
{{ $.Scratch.Set "paginator" (.Paginate (where .Pages "Type" "art")) }}
{{ $tags := slice "fan art" "artfight" }}
{{ $artworks := (where .Pages "Type" "art") }}
{{ $nsfw_art := (where $artworks "Params.nsfw" "=" true) }}
{{ $.Scratch.Set "paginator" (.Paginate (complement $nsfw_art $artworks)) }}
{{ partial "art-gallery" . }}
{{ partial "gallery-js" . }}
{{ end }}

View file

@ -27,10 +27,14 @@
</tr>
{{ end }}
</table>
<hr>
{{ end }}
{{ $paginator := .Paginate (where $.Site.Pages "Type" "art") }}
{{ $tags := slice "fan art" "artfight" }}
{{ $artworks := (where .Pages "Type" "art") }}
{{ $nsfw_art := (where $artworks "Params.nsfw" "=" true) }}
{{ $guest_art := (where $artworks "Params.guest" "=" true) }}
{{ $.Scratch.Set "paginator" (.Paginate (complement $nsfw_art $guest_art $artworks)) }}
{{ partial "art-gallery" . }}
{{ $paginator := (where (where .RegularPagesRecursive "Type" "art") "Params.guest" "=" true) }}

View file

@ -12,7 +12,7 @@
<div class="gutter-sizer"></div>
{{ range (where .Site.RegularPages "Type" "art") }}
{{ if and (eq (.Date.Format "2006") $.Title) (not .Params.guest) }}
{{ if and (eq (.Date.Format "2006") $.Title) (not (or .Params.nsfw .Params.guest)) }}
{{ partial "render-art" . }}
{{ end }}
{{ end }}