Commit Graph
100 Commits
Author SHA1 Message Date
George Cushen e9d82a2421 fix: nested figure in callout 2021-06-02 23:21:23 +01:00
George Cushen 01a25ecaec feat: delay PostCSS processing with resources.PostProcess
resources.PostProcess delays processing of a resource until the rest of the build has finished.

This allows the public folder or Hugo's hugo_stats.json file to be used as the content for PurgeCSS, so that only CSS that is used on the final website will be included.

Close #2318
2021-06-01 19:35:57 +01:00
George Cushen 70cef473ae docs: edit 2021-05-31 19:13:49 +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 81ba175229 fix: 404 "latest" don't list pages which Hugo doesn't render
where

_build:
  render: never
2021-05-26 23:38:49 +01:00
George Cushen f2a5331af0 fix: 404 "latest" order when some pages contain weights
Revert addition of homepage in latest - from prev commit
2021-05-26 23:20:38 +01:00
George Cushen 079a61ab10 fix: 404 "latest" order when some pages contain weights
Prevent Hugo ordering weighted pages higher in the "latest" content list.

Also include course/docs index pages (Hugo "sections") and remove private pages (although Hugo render option is preferred equiv to "private:true")
2021-05-26 23:09:50 +01:00
George Cushen 89d079bcf0 fix: comment 2021-05-25 22:07:30 +01:00
George Cushen f6e3fa4442 chore: bump version 2021-05-25 21:55:51 +01:00
George Cushen 8711be90e7 feat: support custom order for experience
Close #1761
2021-05-25 21:55:30 +01:00
George Cushen 8bba30b81a fix: unminified JavaScript (#2305)
Repeat prev commit action on the init script
2021-05-25 19:51:11 +01:00
George Cushen 83e9ee7542 chore: edit stale config 2021-05-25 19:38:30 +01:00
George Cushen f54794f046 chore: replace defunct Stale bot with GH action 2021-05-22 19:59:22 +01:00
George Cushen 1c4f02fe34 chore: replace defunct Stale bot with GH action 2021-05-22 19:42:27 +01:00
George Cushen 0afcc81296 feat: remove deprecated netlify-cms-academic module
Was replaced by wowchemy-cms module in v5.0 (specifically v5.0.0-beta.3): https://wowchemy.com/blog/v5.0.0-beta.3/

See https://wowchemy.com/docs/getting-started/cms/
2021-04-25 20:12:48 +01:00
George Cushen e9cec2d3e9 feat: add new gradient_angle option to page builder 2021-04-18 20:43:15 +01:00
George Cushen aa4ca206c8 feat: only show User Group headings in People widget when multiple
Hide User Group headings in People widget if admin chooses to only show one user group.
2021-04-18 20:42:27 +01:00
George Cushen 0994df7177 feat: allow SVG as Hero image 2021-04-18 20:41:34 +01:00
George Cushen 171648c808 fix: style mb 2021-04-16 21:57:38 +01:00
George Cushen 1e2347192a fix(widget): error msg 2021-04-16 19:38:34 +01:00
George Cushen ab8d28988e feat(widget): Experience - add brand logo error msg
Close #1781
2021-04-13 20:22:02 +01:00
George Cushen 153cf5b780 feat(widget): show brand logo in Experience + Accomplishments
To use, add SVG brand logo in lowercase to your `assets/media/icons/brands/` folder

BREAKING CHANGE:

Rename `assets/media/icon-pack/` to `assets/media/icons/`

Close #2259
Close #1781
2021-04-13 20:07:59 +01:00
George Cushen 97ff003d9f fix: Language name doesn't appear for zh-Hant
Language name doesn't appear when LanguageCode has a sub-code

The issue appears to be an inconsistency/bug with Hugo's `.Translations` lowercasing zh-Hant to zh-hant without offering a way to get the language code as it was defined.

We can workaround it for now by converting to lowercase to align with Hugo's current implementation.

Fix #2256
2021-04-13 19:56:28 +01:00
George Cushen fda9f39d87 chore: bump min hugo version
To v0.81 to get Hugo bug fixes and enable multiline Hugo tpl refactoring, see https://github.com/gohugoio/hugo/releases/tag/v0.81.0
2021-03-24 19:42:00 +00:00
George Cushen 35b8b1f82c chore: bump version 2021-03-24 19:30:07 +00: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 17505c4581 refactor: Bootstrap JS URI
Rename URI as GitHub Pages doesn't automatically publish folders with underscores.

Netlify was unaffected.

See https://github.com/wowchemy/wowchemy-hugo-modules/discussions/2201#discussioncomment-508553
2021-03-22 00:47:51 +00:00
George Cushen cf32fde824 refactor: yarn format 2021-03-08 21:25:18 +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 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 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
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
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
George Cushen 76478cb4a5 refactor: move test/ and yarn to repo root 2021-02-03 20:14:43 +00:00
George Cushen 3f1c4b4df2 refactor: move test/ and yarn to repo root
Also lint and format entire repo, beyond just wowchemy/ dir

URL encode `(` and `)` in `[#MadeWithWowchemy](...(..)...)` in Readme.md for Prettier
2021-02-03 20:11:16 +00:00
George Cushen 9bbf6fa2a6 feat: support Params.marketing.google_site_verification
Also trial self-closing tags over void tags as Prettier doesn't support void tags: https://github.com/prettier/prettier/issues/5246
2021-02-02 23:55:30 +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 4ac1c6aa1a docs: link to 中文 2021-01-27 22:57:30 +00:00
George Cushen 9e984eca83 feat(security): add Referrer-Policy
Also, support multi-line CSP and Permissions policy
2021-01-27 17:56:25 +00:00
George Cushen 64b7d5189b fix(style): consistency across landing section breakpoints
Fix #2123
2021-01-26 21:46:37 +00:00
George Cushen c15f621515 fix(style): consistency across landing section breakpoints
Fix #2123
2021-01-26 17:44:47 +00:00
George Cushen 393b19c76f feat(security): add support for Permissions-Policy
To use, set Params.security.permissions.policy
2021-01-26 01:01:45 +00:00
Geo 69b7e22be8 ci: add codeQL 2021-01-23 02:49:52 +00:00
George Cushen e0ae7c979c chore: bump version 2021-01-20 02:52:05 +00:00
George Cushen cbf15cd470 fix(slides): enable menu by default 2021-01-20 01:34:24 +00:00
George Cushen 6c7237fc0a feat(cms): add slides editor
Also,
- filter out archive pages
- add `squash_merges`
- convert deprecated valueType to value_type
2021-01-20 01:03:37 +00:00
George Cushen 2d515e5fa5 feat(netlify): add security headers + configurable CSP
Adds some default security headers.

CSP is configurable via Params.security.csp.policy (string) and Params.security.csp.report_only (boolean).

To enable, add `headers` to config.toml > outputs > home

Dedicated Netlify redirects file can also now be generated from front matter `aliases` by adding `redirects` to config.toml > outputs > home, and `disableAliases = true` to config.toml.
2021-01-20 00:12:13 +00:00
George Cushen 9f5c626c8f fix: show button links in listings irrespective of Type
Hugo cannot yet understand more than one return statement.

See https://discord.com/channels/722225264733716590/742863504515793149/800107285246246993
2021-01-16 23:49:44 +00:00
George Cushen b6dc6d8777 feat: show button links in listings irrespective of Type
Extend scope to include Portfolio's Card view.
2021-01-16 22:42:00 +00:00
George Cushen 2b9041dc87 feat: show button links in listings irrespective of Type
For example, if a blog post has an attachment, it will now be linked in the listing as well as in its page header.

May also reduce excess spacing by preventing empty attachment DIV in the case of no attachments/buttons since it now checks if a page has buttons.
2021-01-16 20:48:15 +00:00
George Cushen d4ecdca0eb feat: show button links in listings irrespective of Type
For example, if a blog post has an attachment, it will now be linked in the listing as well as in its page header.

May also reduce excess spacing by preventing empty attachment DIV in the case of no attachments/buttons since it now checks if a page has buttons.
2021-01-16 20:24:05 +00:00
George Cushen 273405e59b refactor: modularise styles + fix more style lint issues 2021-01-14 21:01:41 +00:00
George Cushen ac4b4e3157 fix: style lint issues 2021-01-13 21:27:12 +00:00
George Cushen f1da2c5ca8 feat: book menu - link to book of books if exists
Example: `courses/learn-x/` will have a new item added to the book menu to link back to `courses/` whereas a site with just a first-level book e.g. `docs/` won't see any change to the menu.
2021-01-11 23:53:50 +00:00