Move default media library from static/img/ to static/media/ as it can now contain audio, video, and other kinds of media in addition to images.
BREAKING CHANGE:
Either rename your site's static/img/ to static/media/ (and update any references to this folder in your Markdown files);
Or, add `media_dir = "img"` to `params.toml` to continue using the legacy location.
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.
As of a recent update, gallery and figure images are lazy loaded. However, lazy loading without initial sizes defined can lead to inaccurate anchor scrolling and active link highlighting as the anchor offset changes after an uncached image occurring before the anchor is lazily loaded.
See https://github.com/gcushen/hugo-academic/issues/1199#issuecomment-577293818Fix#1199
The proportion of image data in the typical payload of a website can be significant. Lazy loading is a solution that lowers initial page payload and load time, without removing content. Non-critical resources are instead loaded at the moment that they are needed.
Also, load MathJax async in head if required, rather than at end of body.
Close#1106
To reference file in page folder, simply use
`{{< figure src="a.png" >}}`
To reference file from `static/img/` media library, set `library=1`
in shortcode. E.g. `{{< figure src="a.png" library=1 >}}`
See #708
- Figures are now unnumbered by default
- To number a figure, use the form:
- `{{< figure src="image.jpg" title="Caption" numbered="true" >}}`
- Add i18n translation for "Figure" in captions
- Update English and Chinese language packs
Close#328 and #513