feat: add ID to figures to make them linkable (#1475)

Generates linkable IDs for figures by anchorizing the caption and namespacing the figure ID by prefixing it with `figure-` to help prevent conflicts with other existing IDs.
This commit is contained in:
beckerjohannes authored and GitHub committed 2020-03-06 19:57:33 +00:00
1 parent 90aca0659c
commit f9794e9f09
1 file changed
+1 -1
+1 -1
View File
@@ -18,7 +18,7 @@
{{/* Get caption. Support legacy `title` option. */}}
{{ $caption := .Get "title" | default (.Get "caption") | default "" }}
<figure{{ with .Get "class" }} class="{{.}}"{{ end }}>
<figure{{ with .Get "class" }} class="{{.}}"{{ end }} {{ with $caption }}id="figure-{{ anchorize . }}"{{ end }}>
{{ if $lightbox }}
<a data-fancybox="{{$group}}" href="{{$image_src}}" {{ with $caption }}data-caption="{{ .|markdownify|emojify }}"{{ end }}>