Fix homepage image sizes, add archive.org bot and more

This commit is contained in:
Joshua Goins 2024-10-12 15:38:50 -04:00
parent 628c969dfe
commit 83890cf33d
5 changed files with 16 additions and 26 deletions

File diff suppressed because one or more lines are too long

View file

@ -4,8 +4,9 @@
<div class="gallery-con">
<div style="display: flex; flex-wrap: wrap;">
{{ with .Site.GetPage "/art" }}
{{ range (where (where .RegularPagesRecursive "Type" "art") "Params.slug" "in" $art_config.featured) }}
{{ $art := .Site.GetPage "/art" }}
{{ range (where (where $art.RegularPagesRecursive "Type" "art") "Params.slug" "in" $art_config.featured) }}
{{ with ($art.GetPage .Params.slug) }}
<figure class="gallery-fig">
{{ $filename_without_ext := .Params.slug }}
@ -18,32 +19,18 @@
{{ $year = index $split 0 }}
{{ end }}
{{ $use_newformat := false }}
{{ if ge (int $year) 2023 }}
{{ $use_newformat = true }}
{{ end }}
{{ $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 }}
{{ if $use_newformat }}
{{ $full := printf "%s/thumb/%s.avif" $.Site.Params.image_host $filename_without_ext }}
{{ $jpeg := printf "%s/thumb/%s.jpg" $.Site.Params.image_host $filename_without_ext }}
{{ $full := printf "%s/thumb/%s.avif" $.Site.Params.image_host $filename_without_ext }}
{{ $jpeg := printf "%s/thumb/%s.jpg" $.Site.Params.image_host $filename_without_ext }}
<picture>
<source srcset="{{ $full }}" type="image/avif"/>
<img class="gallery-img featured-art" alt="{{ $title }}" src="{{ $jpeg }}">
</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 }}
<p>Thumbnail not found!</p>
{{ end }}
{{ end }}
<picture>
<source srcset="{{ $full }}" width="{{ .Params.thumb_width }}" height="{{ .Params.thumb_height }}" type="image/avif"/>
<img class="gallery-img featured-art" width="{{ .Params.thumb_width }}" height="{{ .Params.thumb_height }}" alt="{{ $title }}" src="{{ $jpeg }}">
</picture>
</a>
<figcaption>

View file

@ -24,7 +24,7 @@
<area shape="rect" coords="23,3,63,28" href="https://geekring.net/" alt="Geekring">
</map>
{{ with resources.Get "geek_2.gif" }}
<img usemap="#badge-geekring" src="{{ .RelPermalink }}" alt="The Geekring">
<img width="88" height="31" usemap="#badge-geekring" src="{{ .RelPermalink }}" alt="The Geekring">
{{ end }}
{{ end }}
</div>

View file

@ -9,7 +9,7 @@
{{ range .Site.Menus.main }}
<div class="site-menu">
{{ with resources.Get .Params.img }}
<img class="symbolic-icon" style="image-rendering: pixelated;" width="16" height="16" src="{{ .RelPermalink }}">
<img alt="" class="symbolic-icon" style="image-rendering: pixelated;" width="16" height="16" src="{{ .RelPermalink }}">
{{ end }}
<a href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.RelPermalink }}">{{- end -}}</a>
</div>
@ -22,7 +22,7 @@
{{ range .Site.Menus.socials }}
<div class="site-menu">
{{ with resources.Get .Params.img }}
<img style="image-rendering: pixelated;" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
<img alt="" style="image-rendering: pixelated;" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ end }}
<a rel="me" href="{{ .URL }}">{{ .Name }}{{ if strings.HasPrefix .URL "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.RelPermalink }}">{{- end -}}</a>
</div>

View file

@ -12,6 +12,9 @@ User-agent: DuckDuckBot
User-agent: Synapse
User-agent: Mastodon
# Allow archive.org
User-agent: archive.org_bot
# Non-important pages I don't want indexed or one reason or another
Disallow: /shrines/
Disallow: /layout-archive/