Commit Graph
32 Commits
Author SHA1 Message Date
George Cushen e9d82a2421 fix: nested figure in callout 2021-06-02 23:21:23 +01:00
George Cushen 3ea78d2c66 feat: support animated GIF in figures
Workaround Hugo converting animated gifs to static gifs: https://github.com/gohugoio/hugo/issues/5030
2021-05-31 18:59:42 +01:00
George Cushen bbca6dea78 feat: load gallery from media dir & add gallery display options
Add gallery `order` with options "asc" or "desc"

Add gallery `resize_options` which supports Hugo image processing options.

BREAKING CHANGE:
Move gallery album folders to `assets/media/albums/`. Album name should be defined in shortcode as `album`.

Fix #2245
2021-05-31 12:21:56 +01:00
George Cushen 35b5e1d420 feat: move media library from static/ to assets/
Refactor:
- business JSON-LD
- site_head
- Slider
- Gallery
- Video

Gallery is now intended only for local images in the page bundle (so that they can be optimized by Hugo).

Close #2119
2021-03-24 19:29:27 +00:00
George Cushen e14c68cb6d feat: migrate Audio shortcode to use assets/media/
Also support page dir asset or URL
2021-03-08 21:22:08 +00:00
George Cushen f9505c2803 feat: make it easier to upscale figure images 2021-03-06 22:34:13 +00:00
George Cushen 98294a9f1d refactor: simplify Figure style 2021-03-04 17:42:29 +00:00
George Cushen 5529404d19 feat: workaround Hugo v0.81 error on Windows with remote figure
Hugo v0.81 on Windows will error when figure destination is a remote URL such that we have `resources.Get (path.Join "media" <URL>)`.

See https://github.com/wowchemy/wowchemy-hugo-modules/discussions/2205
2021-03-03 11:14:50 +00:00
George Cushen 40e01c083e fix: previous commit - migrate lazysizes data-src to native src 2021-02-22 22:36:15 +00:00
George Cushen 432c6326ee feat: complete migration to native lazy loading
One less JS dependency.
2021-02-22 21:37:48 +00:00
George Cushen a9a74e160d feat: remove deprecated Alert shortcode which was replaced by Callout 2021-02-22 20:29:10 +00:00
George Cushen 0c48d88d80 feat: add support for Figure image theme and max_width
New options:

`theme="light"` inverts image when browsing in dark mode
`theme="dark"` inverts image when browsing in light mode
`max_width="300px"` sets an image max width

Also, improves use of Figure in `{{%` Markdown shortcodes (e.g. Callout) by further stripping HTML indentation.
2021-02-22 20:11:22 +00:00
George Cushen e27cbaca79 feat: enable Figure to be nested within a {{% Markdown shortcode
Based on user request to parse both Markdown and nested HTML shortcodes (Figures) within Callout shortcode: https://discord.com/channels/722225264733716590/742863504515793149/813105748283883570

Uses `{{-` to unindent HTML so that Figure shortcode can be nested within a `{{%` Markdown shortcode, such as Callout, without the HTML being rendered as a Markdown code block. This way we utilise Hugo's HTML in Markdown approach (aka Goldmark `unsafe`) rather than separating HTML from Markdown.

Previously, Figure could only be nested within a `{{<` HTML shortcode.
2021-02-21 21:24:03 +00:00
George Cushen d47703395c fix: callout rendering nested child shortcodes as markdown
See https://discord.com/channels/722225264733716590/742863504515793149/813105748283883570
2021-02-21 18:18:56 +00:00
George Cushen 1d58e5e819 feat: rename assets/images/ to assets/media/ and auto detect sharing image
The file uploader in Wowchemy CMS has also been updated to reflect the change.

BREAKING CHANGES:
- rename assets/images/ to assets/media/
- move default social sharing image (if any) to assets/media/sharing.*
2021-02-20 17:28:11 +00:00
George Cushen eebefd8a59 feat: add option to disable zoom in re-written Figure shortcode
Compatible with previous `lightbox` option.
2021-02-19 13:13:07 +00:00
George Cushen 68595a20ae feat(shortcode): revert to img SVGs
Cacheable, zoomable, and lazily loaded.

Also, prevents conflicts if admin attempts to include multiple inline SVGs which unintentionally reuse each other's components.
2021-02-17 22:21:39 +00:00
George Cushen 0fd5d2a250 feat(style): center figure SVGs 2021-02-17 21:15:12 +00:00
George Cushen 7b235ea453 feat: rewritten Figure shortcode supporting multi-resolutions
New shortcode supports
- enable re-usable *optimized* image assets from new primary media library location at `assets/images/`
- new behavior: load image from page dir falling back to media library at `assets/images/` and then to remote URI.
- multi-res support. leading to increased perf.
- custom ID for cross-refs
- efficient, vanilla (non-jQuery), MIT licensed image zooming
- FancyBox now only loaded for Gallery shortcode
- themeable SVG support
- native lazy loading

Experimental, may change.

BREAKING CHANGE:
Move any figure images (i.e. not the `sharing.*` image) from `static/media/` to `assets/images/`

See #2164
2021-02-14 22:59:12 +00:00
George Cushen 211d8b330b feat: add support for emoji lists
With new `emoji_list` shortcode. For example:

```
{{% emoji_list %}}
- 🔥 sdf
  - 🔥 sdf
- 🔥 sdf
{{% /emoji_list %}}
```
2021-02-10 07:55:09 +00:00
George Cushen 3b32a8188f feat(style): dynamically theme SVGs
And refactor HL shortcode to use semantic <mark>
2021-02-02 23:45:20 +00:00
George Cushen 9872428a3f feat(shortcode): show summaries by default in list_children 2021-01-11 20:53:49 +00:00
George Cushen 468d327370 feat(shortcode): make in-page ToC collapsable
Useful for long pages with large ToCs and/or on small screens.

Also add `hide_on` and `show_on` options accepting Bootstrap responsive breakpoints.

Useful for setting `{{< toc hide_on="xl" >}}` in conjunction with Book layout which only shows right sidebar ToC on XL screens and above.
2021-01-09 20:59:42 +00:00
George Cushen 70c465806c feat: migrate to latest web best practices
Informed by Google Lighthouse insights.

Part 2 - also see 4b9ee3021c
2021-01-06 22:20:27 +00:00
George Cushen dd2bde730e feat(shortcode): migrate Spoiler to new standardized HTML
Toggle lists have now been standardized in HTML. Functions just like the toggle lists on Github.

Also now supports Markdown in title and works better with longer titles (unlike the previous button based component).
2020-12-19 20:17:58 +00:00
George Cushen 8c20b50361 fix(axe): gallery alt 2020-11-23 23:22:32 +00:00
George Cushen 4dc8eff074 fix: Hugo minfiy removes spaces in Figure captions
Add explicit &nbsp; to prevent Hugo stripping desired spaces.

Fix #1972
2020-11-19 20:22:04 +00:00
George Cushen eb76e56841 fix(style): prevent page overflow
Pages with wide horizontal content could horizontally scroll on mobile due to `.page-wrapper` not having fixed width in f851142fb2

Re-add overflow-wrap which was removed in e6dba41f3d (in attempt to simplify logic).

Add horizontal scroll to unresponsive Plotly charts.

Also, refactor chart style and refactor callout styles into dedicated file.

This commit attempts to fix https://discord.com/channels/722225264733716590/742863504515793149/774343154949816350
2020-11-06 21:50:12 +00:00
George Cushen 170204126a feat(shortcode): add cta shortcode for call to action buttons
Examples

Main button CTA:

{{< cta cta_link="https://..." cta_new_tab="true" cta_text="emoji 🚀" >}}

Alternative text CTA:

{{< cta cta_alt_link="./my-page/" cta_alt_text="Go to my page" >}}

Main button CTA and alternative text CTA:

{{< cta cta_link="https://..." cta_new_tab="true" cta_text="emoji 🚀" cta_alt_link="./my-page/" cta_alt_text="Go to my page" >}}
2020-09-27 00:19:35 +01:00
George Cushen bcf6297b11 feat(shortcode): add callout
Add warning that Alert shortcode will be deprecated and replaced with Callout.

Also fix some old Academic refs.
2020-09-26 14:38:39 +01:00
George Cushen d325991ffb feat(shortcode): enable cross-referencing audio
Adds id param to audio shortcode

Hashes are prefixed in the form `#audio-<ID>`

E.g. add `id="my-talk"` when calling the audio shortcode and then reference it using [link to my talk audio](#audio-my-talk)
2020-09-22 23:02:24 +01:00
George Cushen 86da39719c refactor: hugo-academic to wowchemy sub-module 2020-09-02 20:59:27 +01:00