1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12:09 +00:00

Fix: properly use "site" function instead of var

This fixes the logic to use PNGs instead of SVGs for the hidden service.
This commit is contained in:
Rohan Kumar 2022-03-15 13:47:42 -07:00
parent c0666aa259
commit dcbace64a3
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 8 additions and 7 deletions

View file

@ -3,15 +3,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://seirdy.one{{ .RelPermalink }}" rel="canonical">
<link href="https://seirdy.one/webmentions/receive" rel="webmention">
{{- if or (eq .Site.BaseURL "https://seirdy.one/") (eq .Site.BaseURL "http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/") -}}
{{ if or (eq site.BaseURL "https://seirdy.one/") (in site.BaseURL "wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion") }}
<!-- IDC how much content is extracted from my pages, go knock yourself out. huge images, long snippets, whatever. -->
<meta name="robots" content="index,follow,max-image-preview:large,max-snippet=-1">
{{- end }}
{{ end }}
<title>{{ .Title }}{{ if and (lt (len .Title) 66) (ne .RelPermalink "/") }} - Seirdy{{ end }}</title>
<meta name="description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
{{ if (eq .RelPermalink "/") -}}
{{ if (eq .RelPermalink "/") }}
<!--SearchMySite uses keywords to tag webpages-->
<meta name="keywords" content="developer,poggies,blog,indieweb,software,opensource,security,search engines,search,linux">
{{- end -}}
{{ end -}}
<meta content="{{ .Site.Author.name }}" name="author">
<meta property="article:author" content="{{ .Site.Author.name }}">
{{ if gt .Date 0 -}}
@ -21,7 +22,7 @@
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">
{{- end -}}
<!--the Tor Browser's safest setting disables SVGs but still downloads them to avoid fingerprinting-->
{{ if (ne .Site.BaseURL "http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/") -}}
{{ if not (in site.BaseURL ".onion") -}}
{{ $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" }}
{{- printf `<link rel="icon" sizes="any" href="%s" type="image/svg+xml">` $icon_svg.RelPermalink | safeHTML }}
{{- end }}
@ -38,7 +39,7 @@
<!-- webmanifest defines even more icons. This is getting ridiculous -->
{{- $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}}
{{- printf `<link href="%s" rel="manifest">` $webmanifest.RelPermalink | safeHTML }}
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}posts/index.xml" title="{{ $.Site.Title }}">
<link rel="alternate" type="application/rss+xml" href="{{ site.BaseURL }}posts/index.xml" title="{{ $.Site.Title }}">
<!-- inline CSS; remember to allow it with a hash in the CSP -->
{{- $resources := slice -}}
{{- $resources = $resources | append (resources.Get "/css/main.css") -}}

View file

@ -3,7 +3,7 @@
{{- $favicon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
{{- $favicon_bigpng := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
<img itemprop="image" class="u-photo photo" width="16" height="16" alt=""
{{ if (eq .Site.BaseURL "http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/") -}}
{{ if in site.BaseURL ".onion" -}}
src="data:image/png;base64,{{ $favicon_base64 }}" srcset="{{ $favicon_bigpng.RelPermalink }} 2x"
{{- else -}}
src="{{ $favicon_svg.RelPermalink }}"