Przeglądaj źródła

Make figures use name if the title is default

master
Chris Smith 4 lat temu
rodzic
commit
7bc98acfaf
Podpisane przez: Chris Smith <chris@chameth.com> ID klucza GPG: 3A2D4BBDC4A3C9A9
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      site/layouts/shortcodes/figure.html

+ 1
- 1
site/layouts/shortcodes/figure.html Wyświetl plik

@@ -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>

Ładowanie…
Anuluj
Zapisz