mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-22 09:43:11 +01:00
This seems to mostly work! It's configured to work with Agate, and I haven't figured out the deploy mechanism yet — but it's a start!
12 lines
496 B
Text
12 lines
496 B
Text
{{- $src := path.Join (path.Dir .Page.RelPermalink) (.Get "src") -}}
|
|
{{- $title := "An untitled image" -}}
|
|
{{- $caption := (.Get "caption") -}}
|
|
{{- $captionChunks := split $caption "." -}}
|
|
{{- if lt (len (index $captionChunks 0)) 64 -}}
|
|
{{- $title = index $captionChunks 0 -}}
|
|
{{- $caption = delimit (after 1 $captionChunks) "." -}}
|
|
{{- end -}}
|
|
{{- $title := (.Get "title") | default $title -}}
|
|
=> {{ $src }} {{ $title }}
|
|
{{- with $caption }}{{ if ne $title . }}
|
|
> {{ . }}{{ end }}{{ end -}}
|