Commit Graph
12 Commits
Author SHA1 Message Date
George Cushen d9ff93a1c2 feat: make media library dir configurable
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.
2020-07-29 18:54:28 +01:00
George Cushen 47c58faf81 fix(gallery): don't lazy load media library or remote images
`class="lazyload"` was earlier removed but the `data-src` was not reverted to `src`.

Fixes gallery images not loading from `static/img/` or from remote URL.

Fix #1771
2020-07-06 22:00:59 +01:00
George Cushen 55228b7ade fix: lazy loading causing inaccurate anchor scrolling + link highlighting
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-577293818
Fix #1199
2020-01-23 23:44:08 +00:00
George Cushen 361707f4fd feat: lazy load figures and gallery images
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
2019-12-18 14:33:22 +00:00
George Cushen d33d6b0ff6 feat(shortcode): fix Gallery captions + support Markdown in captions
Fixes image captions when the Gallery shortcode is used on Widget Pages.
The issue was caused by a path mismatch in the code.

Adds support for using Markdown and emojis in image gallery captions.

Close #1136 - the bug report.
2019-06-16 19:10:49 +01:00
George Cushen e8966f703a fix(shortcode): remove Hugo 0.55+ deprecation warning for Gallery
Fix #1074
2019-05-11 15:41:13 +01:00
George Cushen ea4621aedb refactor: homepage sections as headless leaf nodes
See #970
2019-03-17 20:31:20 +00:00
George Cushen 3462cadba1 demo: add gallery section 2019-02-20 17:46:08 +00:00
George Cushen e1bcd74ea2 feat(gallery): generate web-friendly thumbnails
Close #932
2019-02-17 18:18:04 +00:00
George Cushen 0ff174bbf4 feat(shortcodes): add support for image gallery in page bundle
To use:

1. Create a gallery album folder in page bundle
2. Add images to album folder
3. Paste `{{< gallery album="<ALBUM FOLDER>" >}}` in your page content

Close #786
2018-11-03 23:27:03 +00:00
George Cushen 6ef19085d4 Refactor most absolute URLs to relative URLs
See #683
2018-09-15 13:58:29 +01:00
George Cushen 72c793b179 Add gallery shortcode (#398) 2018-01-13 15:19:59 +00:00