Commit graph

1362 commits

Author SHA1 Message Date
George Cushen
f9505c2803 feat: make it easier to upscale figure images 2021-03-06 22:34:13 +00:00
George Cushen
1475a49114 fix: JS convert ESM back to iife 2021-03-06 21:45:15 +00:00
George Cushen
142c7c1d5d i18n: sync language packs 2021-03-06 14:44:28 +00:00
George Cushen
fc38e80952 feat: add option to show translations in footer
Adds `Params.footer.show_translations` and `Params.main_menu.show_translations` options
2021-03-05 18:55:08 +00:00
George Cushen
ae4d671d4c feat(style): wider XL container 2021-03-05 17:47:29 +00:00
George Cushen
3edb4ff8e7 feat: get page header image from page dir or assets media library 2021-03-05 17:23:43 +00:00
George Cushen
ae7897c868 feat: add Hero support for design.flip and new media location
Flip reverses the order of the Hero. Can be used with multiple Heros to create the classic alternating feature showcase.
2021-03-05 17:19:57 +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
98294a9f1d refactor: simplify Figure style 2021-03-04 17:42:29 +00:00
George Cushen
1dfeec02ce refactor: ToC hooks 2021-03-03 13:21:07 +00:00
George Cushen
f4b96e1432 refactor: ToC hooks 2021-03-03 12:41:52 +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
3952bfc85c fix: previous commit 2021-02-26 16:45:04 +00:00
George Cushen
33e92dc8cb feat: update widget page to get backgrounds from assets/media/ dir
See #2119
2021-02-26 00:12:49 +00:00
George Cushen
6b9fdd9482 feat: enable Wowchemy attribution to be translated
Add EN and ZH translations.

See https://github.com/wowchemy/wowchemy-hugo-modules/discussions/2161
2021-02-25 18:14:21 +00:00
George Cushen
ad6e481c0a feat: add options for page specific styling or integrations
Page's ID applied to body as `data-wc-page-id`. Can be accessed via CSS and JS to perform page-specific styling or integrations.

Also, introduces new page parameters, similar to widget params:
design.css_style
design.css_class

Close #1975
2021-02-25 16:08:09 +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
69de00c0cd feat: add support for baidu_tongji and baidu_site_verification
The new options can be added under `marketing` in `params.toml`
2021-02-22 20:51:20 +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
61bdd1108d fix: event/talk archive page
Fix https://github.com/wowchemy/wowchemy-hugo-modules/discussions/2187
2021-02-21 18:58:21 +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
05c772f389 fix: responsive Figure aspect ratio in Safari
See https://discord.com/channels/722225264733716590/742863504515793149/812308038174244904
See https://stackoverflow.com/a/61196907
2021-02-19 13:35:16 +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
vesvalim
55fd017f98
i18n: add Finnish (fi) translation (#2178) 2021-02-19 10:39:04 +00:00
George Cushen
dc09534e2b fix: gallery detection on homepage
Workaround HasShortcode detection issue by defaulting to requiring fancybox. Can temporarily be disabled by setting `site.Params.require_fancybox` to `false`
2021-02-19 10:35: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
f37581febe refactor: reflect renamed default branch
site.Params.edit_page.repo_branch will now also default to `main` if unset.
2021-02-19 09:04:29 +00:00
George Cushen
11814feeee fix(disqus): missing comment count in listing previews
Fix #2171
2021-02-19 08:31:12 +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
Arho Huttunen
3cf9f6cdee
fix: comment provider not found (#2165)
Hugo v0.80.0 `Exists` function requires file extension unlike Hugo's Partial statement
2021-02-15 22:41:17 +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
b811f9a1bb chore: bump version 2021-02-11 18:59:22 +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
4c35de770c feat: only load Google Optimize in prod 2021-02-10 08:05:09 +00:00
George Cushen
95e128c8dc feat: support new Google Analytics cookie requirements
Firefox console notice: Cookie “_ga” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute.
2021-02-10 08:00:29 +00:00
George Cushen
ebef2543c3 feat: remove special Book sort for folder named updates 2021-02-10 07:57:23 +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
dbeee61620 feat: add default security permissions policy 2021-02-10 07:49:34 +00:00
George Cushen
aa4fe0c757 docs: new cms branch option 2021-02-09 22:00:00 +00:00
George Cushen
7819a912d2 fix: new cms options 2021-02-09 21:45:52 +00:00
George Cushen
e470c4e2cf feat: add options for branch, local_backend, and publish_mode (editorial flow)
Example for a YAML config:

```
  cms:
    branch: main
    local_backend: true
    publish_mode:
 ```

Close #2124
2021-02-09 21:44:47 +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