image rendering and pages fix
This commit is contained in:
parent
1d48a787c8
commit
3be1608944
4
.github/workflows/pages.yml
vendored
4
.github/workflows/pages.yml
vendored
@ -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
|
||||
|
20
layouts/_default/_markup/render-image.html
Normal file
20
layouts/_default/_markup/render-image.html
Normal file
@ -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 */ -}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user