Browse Source

Make figures use name if the title is default

master
Chris Smith 4 years ago
parent
commit
7bc98acfaf
Signed by: Chris Smith <chris@chameth.com> GPG Key ID: 3A2D4BBDC4A3C9A9
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      site/layouts/shortcodes/figure.html

+ 1
- 1
site/layouts/shortcodes/figure.html View File

@@ -1,5 +1,5 @@
1 1
 {{ $img := $.Page.Resources.GetMatch (.Get 1) }}
2 2
 <figure class="{{ .Get 0 }}">
3 3
     <img src="{{ $img.RelPermalink }}" alt="{{ $img.Name }}">
4
-    <figcaption>{{ $img.Title }}</figcaption>
4
+    <figcaption>{{ if strings.HasSuffix $img.Permalink $img.Title }}{{ $img.Name }}{{ else }}{{ $img.Title}}{{ end }}</figcaption>
5 5
 </figure>

Loading…
Cancel
Save