Skip to content
Discussion options

You must be logged in to vote

@McShelby - thank you, that was a useful read. More importantly, it gave me a pointer to address this from the hugo perspective rather than the theme, something I had not considered.

I didn't want to change all my markdown to use {{<figure >}} rather than my normal markdown, which didn't take that long once I'd changed approaches.

Markdown of: ![Top of the 1kw immersion element, showing its two thermostats (one user settable, one factory set)](2.png)

Now produces

method:

Create new file: /layouts/_default/_markup/render-image.html containing:

{{ $caption := "" }}
{{ if .Title }}
  {{ $caption = .Title }}
{{ else if .Text }}
  {{ $caption = .Text }}
{{ end }}

<figure>
  <img src="{{ .De…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by digdilem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants