1
0

image rendering and pages fix

This commit is contained in:
Andy Pack 2025-04-04 17:01:32 +01:00
parent 1d48a787c8
commit 3be1608944
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
2 changed files with 22 additions and 2 deletions
.github/workflows
layouts/_default/_markup

@ -81,9 +81,9 @@ jobs:
# Deployment job
deploy:
name: Deploy Staging
name: Deploy
environment:
name: staging
name: prod
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build

@ -0,0 +1,20 @@
{{- $url := urls.Parse .Destination -}}
{{- $scheme := $url.Scheme -}}
<img src="
{{- if eq $scheme "" -}}
{{- if strings.HasSuffix $url.Path ".md" -}}
{{- relref .Page .Destination | safeURL -}}
{{- else -}}
{{- printf "/%s%s" .Page.File.Dir .Destination | safeURL -}}
{{- end -}}
{{- else -}}
{{- .Destination | safeURL -}}
{{- end -}}"
{{- with .Title }} title="{{ . | safeHTML }}"{{- end -}}
{{- with .Text }} alt="{{ . | safeHTML }}"
{{- end -}}
/>
{{- /* whitespace stripped here to avoid trailing newline in rendered result caused by file EOL */ -}}