Commit Graph
50 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 ca4f7b07ef feat: add Audio shortcode 2020-07-29 13:57:10 +01:00
George Cushen 4afdb4deba feat: add cite shortcode 2020-07-29 13:56:16 +01:00
George Cushen 0b9cbc4150 feat: add Book layout
Similar to the Docs layout but much easier to use.

Add `type: book` to a page's front matter and place Markdown files within a folder hierarchy to automatically create the book sidebar navigation.

Introduces {{< list_children >}} shortcode for listing children of a book chapter.
2020-07-25 01:47:37 +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 3830aed960 fix: prevent all spoilers opening when have same button text
Fix #1723
2020-05-30 11:03:37 +01:00
George Cushen dbeb7fd871 feat: enable rich text in figure lightbox captions
By adding `safeHTMLAttr`, similarly to the gallery shortcode.

Enables links to show within the figure lightbox, for example.

Close #1706
2020-05-28 21:52:04 +01:00
George Cushen 8af8d15d82 feat: add spoiler shortcode
To use:
{{< spoiler text="Click to view the spoiler" >}} You found me! {{< /spoiler >}}

Close #1712
2020-05-28 21:09:54 +01:00
George Cushen 601620c7a6 feat: make taxonomy URLs singular
- make taxonomy URLs singular, consistent with other Academic pages (workaround Hugo attempting to publish taxonomy URLs with plural names). This requires the breaking change below.
- Fix extra space/lines appearing in the author cards underneath page content as reported at https://spectrum.chat/academic/help/publication-widget-adds-additional-lines-at-bottom-of-the-page~315f77d8-7cc8-44a9-a431-5b64b7556c53

BREAKING CHANGE:
Rename `name` to `title` in author profiles within `author/` folder.
2020-04-15 01:17:56 +01:00
beckerjohannes f9794e9f09 feat: add ID to figures to make them linkable (#1475)
Generates linkable IDs for figures by anchorizing the caption and namespacing the figure ID by prefixing it with `figure-` to help prevent conflicts with other existing IDs.
2020-03-06 19:57:33 +00:00
George Cushen 94e6169320 fix: revert "fix: workaround Hugo GetPage/urlize bug with non-ASCII usernames"
This reverts commit 03af4df1

Ensure `removePathAccents = true` in `config.toml` to workaround the Hugo bug: https://github.com/gohugoio/hugo/issues/5687

Fix #1575
Fix #1563
2020-03-05 19:54:20 +00:00
George Cushen 2f00beab89 feat: default to fixed width icons with icon shortcode 2020-01-26 00:52:40 +00:00
George Cushen 581faa19e7 feat: add icon shortcode to render icons within Markdown content
See https://sourcethemes.com/academic/docs/writing-markdown-latex/#icons
2020-01-25 22:39:22 +00:00
George Cushen 7b4470ebb5 fix: 55228b7ade
Fix figure images not loading when not within page bundle.
2020-01-24 02:08:50 +00: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 03af4df12a fix: workaround Hugo GetPage/urlize bug with non-ASCII usernames
Attempt to use anchorize rather than urlize for fetching user profiles for users with non-ASCII usernames. Apparently `anchorize` does not perform URL encoding unlike `urlize`, so may be better suited for use with `GetPage`.

See https://github.com/gohugoio/hugo/issues/5687
2019-12-15 16:16:09 +00:00
Simone Rossi d0fb759153 feat: add Mention shortcode to mention people
To mention someone, type `{{% mention "username" %}}` where `username` corresponds to a user account in Academic. This will create a link to the user's profile page.

Close #1421
2019-11-16 16:14:08 +00:00
George Cushen 2192b11d04 style: center figure captions
Since figures are now centered.
2019-09-14 19:41:11 +01:00
George Cushen c163931702 fix: HTML5 validation errors on Demo site
Fix #1197
2019-09-11 17:25:12 +01:00
George Cushen e24de2a2ca feat: support .webm videos in Video Shortcode
Close #1226
2019-07-27 21:07:12 +01:00
George Cushen 72a5e5b8c0 feat(shortcode): enable figure lightbox by default
Add "lightbox"="false" to shortcode args to disable
2019-07-23 20:56:40 +01:00
Russell J. Hewett 3e6ab0cf69 feat(shortcode): add lightbox option to Figure (#1146)
Example: `{{< figure src="example.png" lightbox="true" >}}`
2019-06-19 23:16:35 +01: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 8914b83cd7 refactor(shortcode): rename mermaid to diagram 2019-05-27 18:09:19 +01:00
George Cushen 27ff391ab1 feat: generate diagrams and flowcharts from text using Mermaid shortcode
To use, add `diagram: true` to a page's YAML front matter and create a
diagram from text in the body of the Markdown file using Mermaid syntax:
https://mermaidjs.github.io

Close #1111
2019-05-27 18:05:17 +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 507523aeb9 fix(widget): Hugo 0.55 broke display of taxonomy term names (e.g. tags)
Prior to this update, Hugo began displaying urlized tags like
`deep-learning` rather than `Deep Learning` in the Tag Cloud widget and
the list_tags/categories shortcodes.

Fix #1072
2019-05-07 22:55:02 +01:00
George Cushen 585bdf643b fix: add support for Hugo v0.55
Requires Hugo v0.55.2+.
Does not work with Hugo v0.55.0 due to bugs fixed in v0.55.2.

Fix #1017
2019-04-17 19:26:51 +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 bc7e541f61 fix(shortcode): allow for multiple child elements in Alerts
Previously, alerts were designed just for a single child consisting of
a paragraph.

Now supports styling of multiple children including lists.

Fix #881
2019-01-15 18:30:02 +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 9bcecc7b25 shortcodes: Update figure and video to support files within page dir
To reference file in page folder, simply use
`{{< figure src="a.png" >}}`

To reference file from `static/img/` media library, set `library=1`
in shortcode. E.g. `{{< figure src="a.png" library=1 >}}`

See #708
2018-09-23 23:10:34 +01:00
George Cushen 6faf695727 Add slides feature
Example added to `exampleSite/content/slides/example-slides.md` and
linked from `exampleSite/content/talk/example-talk.md`.

Close #693
2018-09-16 16:39:30 +01:00
George Cushen 6ef19085d4 Refactor most absolute URLs to relative URLs
See #683
2018-09-15 13:58:29 +01:00
George Cushen 11a5d1bf50 gdocs shortcode: Support all doc types (Slides, Docs, Sheets, etc.)
- Shortcode syntax changed to: {{< gdocs src="https://..." >}}
 - Use with Google Docs `embed` URL rather than `link` URL.

 Close #544
2018-07-15 19:43:27 +01:00
George Cushen 74b0b6f508 shortcodes: Add list_tags and list_categories
To use:

`{{< list_tags >}}` to provide a list of linked tags.
`{{< list_categories >}}` to provide a list of linked categories.
2018-07-15 02:25:09 +01:00
George Cushen 7f25b7463e shortcode: Add Google Docs
Enables easily embedding Google Slides.

To use, copy and paste the share link from Google Docs in the form:
`{{< gdocs "https://..." >}}`
2018-04-22 12:25:51 +01:00
George Cushen e6b2f1d285 Add hl shortcode for highlighting key phrases
To use: `{{< hl >}}highlighted quote{{< /hl >}}`
2018-04-22 00:08:56 +01:00
George Cushen 09674dd538 figure shortcode: Fix caption style
See #328
2018-04-21 23:19:43 +01:00
George Cushen f23526e55d figure shortcode: Support i18n and unnumbered captions
- Figures are now unnumbered by default
- To number a figure, use the form:
  - `{{< figure src="image.jpg" title="Caption" numbered="true" >}}`
- Add i18n translation for "Figure" in captions
- Update English and Chinese language packs

Close #328 and #513
2018-04-21 10:35:15 +01:00
George Cushen 66b71fa2f6 Add video shortcode and remove image shadow 2018-01-28 01:14:44 +00:00
George Cushen 72c793b179 Add gallery shortcode (#398) 2018-01-13 15:19:59 +00:00
George Cushen f752b362f0 staticref shortcode: Fix formatting by removing whitespace (Fix #295) 2017-10-08 12:56:39 +01:00
George Cushen 143576bc99 staticref shortcode: Add "newtab" option to open link in new tab 2017-10-07 20:26:21 +01:00
George Cushen a2b482dc10 Add staticref shortcode for linking files + update docs (#236) 2017-09-03 17:06:06 +01:00
George Cushen 06dc780e6c Add shortcode for generating table of contents (#258) 2017-09-03 15:07:38 +01:00
George Cushen b8b6c88f60 Add alert shortcode
Alerts can be used to add side content such as tips, notes, or warnings to articles.
2016-10-19 00:08:54 +01:00