Commit Graph
39 Commits
Author SHA1 Message Date
George Cushen bd11c2663b fix: Mermaid diagrams not rendered on race condition
Appears to be race condition when using Mermaid's automatic rendering with `startOnLoad: true` option.

Workaround by manually rendering diagrams.
2021-03-08 21:19:19 +00:00
George Cushen d70e23ef55 refactor: build JS as ESM
Remove Bootstrap sourcemap ref as Hugo doesn't detect/publish it.
2021-03-04 19:00:51 +00:00
George Cushen 3ae036b9c3 feat(style): update Bootstrap from 4.5 to 4.6
Get fixes and minor improvements
2021-02-19 10:01:40 +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 c36f3b7878 feat: auto scroll active book menu and ToC links into view
Also, fix ScrollSpy highlighting previous ToC link for some Book anchors.

Close #1964
2021-02-10 08:25:28 +00:00
George Cushen 60d36e66d2 refactor: rename options for maps, search, and comments
Use provider names rather than integers.

BREAKING CHANGE:

- Rename `site.Params.comments.engine` to `site.Params.comments.provider`
- Rename `site.Params.search.engine` to `site.Params.search.provider`
- Rename `site.Params.map.engine` to `site.Params.map.provider`
- Use provider name (string) rather than integer
- For built-in search, provider is "wowchemy"
- For leaflet maps, the provider is "mapnik" or "mapbox"
2021-02-09 21:19:42 +00:00
George Cushen 50d3d41e9e feat: dispatch wcThemeChange event to support themeable user plugins
See https://discord.com/channels/722225264733716590/742863504515793149/807370581611511858
2021-02-05 22:48:25 +00:00
George Cushen aa1071adfc feat: support site.Params.marketing.google_optimize
Also:

- refactor Bootstrap JS out of wowchemy.js for easier maintenance
- refactor lengthy env checks to hugo.IsProduction
- refactor window.PlotlyConfig from inline JS to the init script
- no longer prevent loading GA if GTM provided, in case user wants both
2021-02-05 20:30:40 +00:00
George Cushen 5072eddcc1 feat: add Wowchemy CMS module 2021-02-03 20:32:25 +00:00
George Cushen cbf15cd470 fix(slides): enable menu by default 2021-01-20 01:34:24 +00:00
koutbo6 de6860b8b3 feat(slides): upgrade reveal.js from v3.8.0 to v4.1.0 (#2018) 2021-01-19 23:22:34 +00:00
George Cushen 273405e59b refactor: modularise styles + fix more style lint issues 2021-01-14 21:01:41 +00:00
George Cushen a4bc42feb6 refactor: lint JS
Follows on from d18b2c9def
2021-01-09 19:53:11 +00:00
George Cushen e233094d2c Revert "refactor: format code"
This reverts commit 067b2a7f

Github Action didn't pick up ignored file list.
2021-01-09 19:51:56 +00:00
gcushen 067b2a7f09 refactor: format code 2021-01-09 19:38:09 +00:00
George Cushen d18b2c9def refactor: lint JS and SCSS
Add JS and style linters.
All JS linted and refactored.
TODO: Further SCSS refactoring required - temporary "no-descending-specificity" rule added.
2021-01-09 18:13:47 +00:00
George Cushen 3d8b76f092 refactor(js): run code formatter 2021-01-08 23:29:50 +00:00
George Cushen 68b9925c93 fix(js): no Popper tooltips when search disabled
Fix #2084
2021-01-06 23:32:22 +00:00
Tony Lam 6bcba757cd feat(js): migrate Google Maps options to be compatible with latest API
Google have deprecated and changed options in the API.

See https://developers.google.com/maps/documentation/javascript/reference/map
See #2075
2021-01-05 19:09:58 +00:00
George Cushen ccd2ab1ce2 fix(js): case of theme variation flicker
The set of conditions that can cause a flicker in this case are `day_night: true` (allow visitor to change theme mode) with a dark theme (`light: false`) and a user device which prefers dark themes.

Fix #2080
2021-01-05 18:54:35 +00:00
George Cushen 25e0b0627f feat: support common queries in search dialog
Common queries can be added to `data/search_queries.yaml` (experimental feature).
Refactor Wowchemy keyboard shortcut parser.
Fix JS/CSS assets being minified/fingerprinted in dev env.

Close #2060
2020-12-30 22:46:46 +00:00
George Cushen 219b05cbd2 refactor: support any event type
Informed by user demand to support all event types rather than just talks.

Brings consistency to further align Academic and Research Group templates.

BREAKING CHANGE:

Rename `talk` folder to `event`
Remove `type` set to `talk` in any event front matter (if applicable)
To keep existing `/talk/` URLs, set the following in `config.toml`:

```
[permalinks]
  events = "/talk/:slug/"
```
2020-12-28 23:18:01 +00:00
George Cushen 0eb331a7f6 fix(js): theming flash
Fix case of potential theming flash when `day_night` disabled.

Fix 6c434e6de2
2020-12-21 00:59:06 +00:00
George Cushen 6c434e6de2 refactor: fixMermaid() to dedicated vanilla JS module
Refactored from JQuery.
Module can now also be imported for use in Reveal v4 PR.

Also fix Theme Chooser due to 5b7f5da refactor.

See #2018
Fix 5b7f5da
2020-12-20 00:45:21 +00:00
George Cushen 5b7f5daa5b fix: Mermaid and HLJS theming
A recent refactor caused Mermaid and HLJS themes to not always be applied correctly, for example with theme pack default of light mode but user chosen Dark mode.
2020-12-19 23:10:16 +00:00
George Cushen 769d5f0ad1 feat: if using GitHub API, reduce requests in dev env
For sites using the `.js-github-release` feature to get the latest release of their project, prevent sending request to GitHub everytime Hugo Server reloads pages.
2020-12-19 15:32:48 +00:00
George Cushen f6090cd7e5 fix: JS when Portfolio widget created without a toolbar 2020-12-11 02:36:54 +00:00
George Cushen 1d54566688 refactor: JS 2020-12-08 22:17:17 +00:00
George Cushen d70da89199 fix: Mermaid and Plotly page overflow
Mermaid and Plotly need to have their max-width constrained or they can overflow page width as they set their own fixed max-width in pixels, which can be wider than the page.

One workaround is to set `grid-template-columns` to `100%`. Another is to set a responsive fixed max-width on their parent elements or article-container.

Fix 1c05374
2020-12-05 22:43:43 +00:00
George Cushen cdcfa2da28 fix: load page with hash + multiple Portfolio widgets with images
In case of loading a page with a hash set and having multiple Portfolio widgets (Isotope instances) with images, scroll directly to the offset only once all Isotope instances have fully loaded their images and initialised.

Fixes issue with scrolling conflicts due to 600ms hash scroll on page load combined with 600m hash scroll on each Isotope widget loaded, whilst hash offset, if occurring after one or more Portfolio widgets, can be converging.

Replace JS approach for onload scroll to anchor with CSS scroll-padding-top, now that the CSS standard added support for scroll offsets.

Fix #1992
2020-11-29 12:47:59 +00:00
George Cushen 786b0341ee feat: migrate to ES6 modules + Hugo's JS build system
The latest Hugo version, v0.78, enables support for JS ES6 module build support within Hugo/Go modules.

Initial refactor to ES6 modules with imports/exports. Further refactoring todo.

Refactor to use Hugo's new approach to JS param injection.

Refactor theming code from JQuery to vanilla JS.

Add fix for browser deprecation of the MediaQueryList listener.

Requires Hugo 0.78+

See #1929
See #1930
See #1402
2020-11-15 16:12:52 +00:00
George Cushen 9ee65a120f fix: remove scrollToAnchor() from dropdown mouseover
Had somehow got enclosed in the wrong code block.
2020-11-13 21:38:07 +00:00
George Cushen e8c96d1db9 feat: remove back to top button
Limited use given the fixed navbar and ToC sidebar for Books
2020-10-28 22:21:27 +00:00
George Cushen 61e85bbd76 perf: add require_isotope option (experimental)
If a site doesn't require Isotope Layout Engine (i.e. not using filter on publication archive page or the Portfolio widget), it can be disabled in params.toml for performance increase:

require_isotope = false
2020-10-27 19:03:51 +00:00
George Cushen 0583f02f70 feat: improvements to author list
- Re-refactor code to use Hugo's `GetTerms` function now that Hugo fixed the unordered bug
  - GetTerms may provide better support for names with unicode or spaces
- Use Bootstrap's bundled PopoverJS for *instant* and more legible author note tooltips.
- Make author notes more intuitive and mobile friendly - use FA icon with left padding to discern touches.
- Add support for highlighting multiple author names (e.g. team members)

BREAKING CHANGE:

To highlight an author name, add `highlight_name: true` to the author's profile.

Close #1750
Fix #1861
Close #1864
2020-09-30 15:43:50 +01:00
George Cushen c67339ac16 refactor: update remaining Academic refs 2020-09-26 23:16:52 +01:00
zertrin 841053c6c8 feat(widget): update Mapbox API due to classic style deprecation
Since June 1, 2020, the Mapbox classic styles are deprecated and may be removed in the future.
This change updates the Leaflet code to use the currently supported Mapbox style API according to the official documentation at https://docs.mapbox.com/help/troubleshooting/migrate-legacy-static-tiles-api/

See #1854
2020-09-25 16:28:21 +01:00
George Cushen c4ce9f5bd3 feat(menu): change palette icon to moon + add option to hide search
- a static moon icon is currently commonly used by popular sites such as Facebook and Reddit to represent a light/dark chooser
- fix automatic light/dark theming when the chooser is hidden with `show_day_night` set to `false`
- add boolean `show_search` option to `main_menu` in `params.toml` to hide search button from main (still accessible from the standard / keyboard shortcut)
2020-09-20 14:26:29 +01:00
George Cushen 86da39719c refactor: hugo-academic to wowchemy sub-module 2020-09-02 20:59:27 +01:00