diff --git a/i18n/en.yaml b/i18n/en.yaml index ff197211..59aeafe8 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -20,6 +20,9 @@ - id: next translation: Next +- id: figure + translation: "Figure %d:" + # Buttons - id: btn_preprint diff --git a/i18n/zh.yaml b/i18n/zh.yaml index aa408975..f025e37d 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -14,6 +14,15 @@ - id: minute_read translation: 分钟阅读时间 +- id: previous + translation: 上一页 + +- id: next + translation: 下一页 + +- id: figure + translation: "图%d:" + # Buttons - id: btn_preprint diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index a9bc68e9..60122a42 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -139,12 +139,6 @@ video { margin: 0 auto; } -figcaption:before { - font-weight: 700; - text-transform: uppercase; - content: "Figure " counter(captions) ": "; -} - figcaption { display: block; margin-top: 0.75em; @@ -152,6 +146,15 @@ figcaption { font-size: 1rem; margin-bottom: 1.65rem; font-family: '{{ .Get "heading_font" }}', sans-serif; +} + +figcaption.numbered:before { + font-weight: 700; + text-transform: uppercase; + content: attr(data-pre) counter(captions) attr(data-post); +} + +figcaption.numbered { counter-increment: captions; } diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 00000000..a746ebc8 --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,17 @@ + +{{ if .Get "link"}}{{ end }} + +{{ if .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" }}

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

+ {{ .Get "caption" }} + {{ with .Get "attrlink"}} {{ end }} + {{ .Get "attr" }} + {{ if .Get "attrlink"}} {{ end }} +

{{ end }} +
+{{ end }} + \ No newline at end of file