mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
🐛 Fix i18n apostrophes in JS, schema author image, avatar crops
JSON-encode i18n strings injected into appearance.js (#3040), resolve and publish the original author image for the JSON-LD schema (#3037), and anchor avatar crops to Center so small and zoomed framings match (#3016). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6e4156e6b
commit
b05eff3b30
6 files changed
+25
-13
No files matched your search
@@ -11,9 +11,9 @@
|
||||
{{ $final := $authorImage }}
|
||||
{{ $squareImage := $authorImage }}
|
||||
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
|
||||
{{ $final = $authorImage.Fill "192x192" }}
|
||||
{{ $final = $authorImage.Fill "192x192 Center" }}
|
||||
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d Center" $shortSide $shortSide ) }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="!mt-0 !mb-0 h-24 w-24 rounded-full me-4"
|
||||
@@ -27,9 +27,9 @@
|
||||
{{ $final := $authorImage }}
|
||||
{{ $squareImage := $authorImage }}
|
||||
{{ if not $disableImageOptimization }}
|
||||
{{ $final = $authorImage.Fill "192x192" }}
|
||||
{{ $final = $authorImage.Fill "192x192 Center" }}
|
||||
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d Center" $shortSide $shortSide ) }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="!mt-0 !mb-0 h-24 w-24 rounded-full me-4"
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
{{ $final := $authorImage }}
|
||||
{{ $squareImage := $authorImage }}
|
||||
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 Center q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d Center" $shortSide $shortSide ) }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="mb-2 h-36 w-36 rounded-full"
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
{{ $final := $authorImage }}
|
||||
{{ $squareImage := $authorImage }}
|
||||
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 Center q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d Center" $shortSide $shortSide ) }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="mb-2 h-36 w-36 rounded-full"
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
{{ $final := $authorImage }}
|
||||
{{ $squareImage := $authorImage }}
|
||||
{{ if not (or $disableImageOptimization (eq $authorImage.MediaType.SubType "svg")) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $final = $authorImage.Fill (print "288x288 Center q" ( $.Site.Params.Author.imagequality | default "96" )) }}
|
||||
{{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }}
|
||||
{{ $squareImage = $authorImage.Crop (printf "%dx%d Center" $shortSide $shortSide ) }}
|
||||
{{ end }}
|
||||
<img
|
||||
class="mb-2 h-36 w-36 rounded-full"
|
||||
|
||||
@@ -46,7 +46,19 @@
|
||||
"author" : {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author.name | safeJS }}"{{ with $author.image }},
|
||||
"image": {{ . | absURL }}{{ end }}{{ if $sameAs }},
|
||||
{{- $authorImageURL := "" }}
|
||||
{{- if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{- $authorImageURL = . }}
|
||||
{{- else }}
|
||||
{{- with resources.Get . }}
|
||||
{{- /* Publish the original so the schema URL resolves even when
|
||||
every other reference uses optimised variants. */}}
|
||||
{{- $authorImageURL = .Permalink }}
|
||||
{{- else }}
|
||||
{{- $authorImageURL = . | absURL }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
"image": {{ $authorImageURL }}{{ end }}{{ if $sameAs }},
|
||||
"sameAs": [{{ range $i, $u := $sameAs }}{{ if $i }}, {{ end }}{{ $u }}{{ end }}]{{ end }}
|
||||
},
|
||||
{{ with .PublishDate }}"copyrightYear": "{{ .Format "2006" }}",{{ end }}
|
||||
|
||||
Reference in new issue
Block a user