diff --git a/assets/sass/academic/_root.scss b/assets/sass/academic/_root.scss index 89406905..23e62ba2 100644 --- a/assets/sass/academic/_root.scss +++ b/assets/sass/academic/_root.scss @@ -138,10 +138,10 @@ video { figcaption { display: block; margin-top: 0.75em; - line-height: 1.25; - font-size: 1rem; margin-bottom: 1.65rem; - font-family: $sta-font-heading, sans-serif; + line-height: 1.4; + font-size: 0.76rem; + text-align: center; } figcaption.numbered:before { @@ -154,13 +154,6 @@ figcaption.numbered { counter-increment: captions; } -figcaption h4 { - display: inline; - font-size: 1rem; - font-weight: 400; - margin: 0; -} - pre, code { font-family: $sta-font-mono, monospace; diff --git a/exampleSite/content/post/getting-started/index.md b/exampleSite/content/post/getting-started/index.md index 56c4add3..69ffcccf 100644 --- a/exampleSite/content/post/getting-started/index.md +++ b/exampleSite/content/post/getting-started/index.md @@ -49,7 +49,7 @@ projects: [] - 👕 [Wear the **T-shirt**](https://academic.threadless.com/) - :woman_technologist: [**Contribute**](https://sourcethemes.com/academic/docs/contribute/) -{{< figure src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png" lightbox="true" >}} +{{< figure src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png" title="Academic is mobile first with a responsive design to ensure that your site looks stunning on every device." >}} **Key features:** diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 95dcdcab..3d406b62 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -3,27 +3,34 @@ {{ if .Get "library" }} {{ $image_src = printf "img/%s" $image_src | relURL }} {{ end }} + +{{/* Disallow user from opening image in the lightbox? */}} {{ $lightbox := eq (.Get "lightbox" | default "true") "true" }} + +{{/* Get lightbox group for showing multiple images in a lightbox. */}} {{ $group := .Get "lightbox-group" | default "" }} +{{/* Get caption. Support legacy `title` option. */}} +{{ $caption := .Get "title" | default (.Get "caption") | default "" }} + + {{ if $lightbox }} - + {{ else if .Get "link"}} +{{ end -}} + +{{ with .Get + +{{- if or $lightbox (.Get "link") }}{{ end }} + +{{ if $caption }} + {{/* Localize the figure numbering (if enabled). */}} + {{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }} + + {{ $caption | markdownify | emojify }} + {{ end }} -{{ if or (.Get -{{ if or $lightbox (.Get "link") }}{{ end }} -{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} -{{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }} -
- {{ if isset .Params "title" }}

{{ .Get "title" | markdownify | emojify }}

{{ end }} - {{ if or (.Get "caption") (.Get "attr")}}

- {{ .Get "caption" | markdownify | emojify }} - {{ with .Get "attrlink"}} {{ end }} - {{ .Get "attr" }} - {{ if .Get "attrlink"}} {{ end }} -

{{ end }} -
-{{ end }} +