Commit graph

103 commits

Author SHA1 Message Date
Bjørn Erik Pedersen 4852a37653
Merge commit '3902f9a4767fe6e62ac5146728d8311b8cd227e0' 2022-04-28 11:52:15 +02:00
Bjørn Erik Pedersen 5b5dcb8d5a
Merge commit 'ec920363cdeb687c8bcac9c242767d366fb058cb' 2022-04-08 13:32:01 +02:00
Cathrine Paulsen da00e7714e
Add environment as a new filter to _cascade.target
Fixes #9612
2022-04-05 09:41:24 +02:00
Bjørn Erik Pedersen d7497b28c1
Merge commit 'd276e901b36d2576ef8350ed96b17f66254eac1b' 2022-03-26 11:04:57 +02:00
Bjørn Erik Pedersen 9d76b8fa34
Merge commit 'd706529720b3b2ccb99719ccd578062ca25a0cc2' 2022-03-08 19:39:33 +01:00
Bjørn Erik Pedersen 08fdca9d93 Add Markdown diagrams and render hooks for code blocks
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`).

We also used this new hook to add support for diagrams in Hugo:

* Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams.
* Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information.

Updates #7765
Closes #9538
Fixes #9553
Fixes #8520
Fixes #6702
Fixes #9558
2022-02-24 18:59:50 +01:00
John Elliott 7732da9f93 Allow images to be cropped without being resized
Introduces the Crop method for image processing which implements gift.CropToSize. Also allows a smartCrop without resizing, and updates the documentation.

Fixes #9499
2022-02-23 10:01:50 +01:00
Bjørn Erik Pedersen c707b71cdf
Merge commit '230a495941b191af0bdaa7e2fc8c61607cb38207' 2022-02-14 12:58:42 +01:00
Joe Mooring d1109f590a Fix validation of Page Kind in cascade target map
Fixes #8888
2022-02-10 20:42:31 +01:00
Bjørn Erik Pedersen 098254f175
Merge commit 'a8e9fc699a6ff7d578f97a7c553ce844efad8fdb' 2022-01-12 08:16:35 +01:00
Bjørn Erik Pedersen 6183184b96
Merge commit '45e6fdb315d113ba13e20a633ed0c67e3f25170d' 2021-12-13 21:05:10 +01:00
Bjørn Erik Pedersen 6c841a691e
Merge commit '8d9511a08f14260cbfb73119e4afae50e5a9966d' 2021-12-08 08:54:25 +01:00
Joe Mooring 0cc39af682 Update Twitter shortcode oEmbed endpoint
The existing endpoint will be retired and removed on November 23, 2021.
References:

- https://twittercommunity.com/t/consolidating-the-oembed-functionality/154690
- https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api#Embedded

This is a backward compatible change.

The existing endpoint requires a single parameter: the id of the tweet.

The new endpoint requires two parameters: the id of the tweet, and the
user with whom it is associated. For the moment, if you supply the wrong
user, the request will be redirected (with a small delay) to the correct
user/id pair. This behavior is undocumented, but we will take advantage
of it as Hugo site authors transition to the new syntax.

{{< tweet 1453110110599868418 >}} --> works, throws warning, deprecate at some point

{{< tweet user="SanDiegoZoo" id="1453110110599868418" >}} --> new syntax

Fixes #8130
2021-11-01 15:51:00 +01:00
Bjørn Erik Pedersen 4b36498a85
Merge commit 'aa5ac36a3eb68b86c803caec703869efefc8447e' 2021-10-31 13:53:55 +01:00
Helder Pereira d966f5d08d highlight: Remove some pygments references 2021-08-21 15:50:49 +02:00
Bjørn Erik Pedersen 7907d24ba1
tpl/lang: Add new localized versions of lang.FormatNumber etc.
Fixes #8820
2021-07-29 16:40:06 +02:00
Bjørn Erik Pedersen 4479f09c9c
Merge commit '7eb0e10a80708c638554b8221a3120dc1168566c' 2021-07-04 16:34:53 +02:00
Bjørn Erik Pedersen 162f41d0ef
Merge commit '32ba623541d74ee0b7ae4efb1b8326dc49af28b8' 2021-06-08 18:47:53 +02:00
Bjørn Erik Pedersen 23fc65832c
docs: Fix shortcode 2021-05-01 13:01:23 +02:00
Bjørn Erik Pedersen d7b22aee46
Merge commit 'c239c643fee10bfa217cb108755b798f8f5f3b10' 2021-05-01 11:45:45 +02:00
Bjørn Erik Pedersen 8f7891e70c
Merge commit '07b8d9466dfb59c429c1b470a0443337bc0aeefe' 2021-04-20 20:22:53 +02:00
Bjørn Erik Pedersen 33d5f80592
Add webp image encoding support
Fixes #5924
2021-04-15 17:22:55 +02:00
Bjørn Erik Pedersen 2dc222cec4
Add slice syntax to sections permalinks config
Fixes #8363
2021-03-30 07:55:24 +02:00
Bjørn Erik Pedersen c94aa5cf46
Merge commit '81689af79901f0cdaff765cda6322dd4a9a7ccb3' 2021-03-21 13:31:17 +01:00
gzagatti 01dd7c16af Fixes #7698.
markup: Allow installed arbitrary Asciidoc extension via path validation.
2021-02-22 13:52:04 +01:00
Bjørn Erik Pedersen a1a9f088b1
Merge commit 'e48ffb763572814a3788780bb9653dfa2daeae22' 2021-01-20 12:48:39 +01:00
Bjørn Erik Pedersen 81975f847d Fix Resource.ResourceType so it always returns MIME's main type
The one exception being for the Page, which does not have a MIME type, in which you will get the value `page`.

Fixes #8052
2020-12-17 22:20:12 +01:00
Andrew Zenk 4fc918e02c
tpl: Add title parameter to YouTube shortcode 2020-12-02 12:53:53 +01:00
Bjørn Erik Pedersen 4f1e4bb3fe
Merge commit '9f1265fde4b9ef186148337c99f08601633b6056' 2020-11-27 09:30:05 +01:00
David Jones 8f5c9a747f
Add menu params
Fixes #7951
2020-11-22 22:09:59 +01:00
Bjørn Erik Pedersen c64e9504d8
Merge commit 'b74591123eac47a20d1f26ff3e2d291cd9c5cfc0' 2020-11-03 13:05:34 +01:00
Bjørn Erik Pedersen 3553fc533a
Merge commit '9cabb46f68bae01aeb1859727dcb21e8a10f5ec7' 2020-10-30 09:50:15 +01:00
Bjørn Erik Pedersen 5e39eb20a6
Merge commit 'e5568488051a571df48401e03f1304b95dbc9028' 2020-10-06 16:24:00 +02:00
Bjørn Erik Pedersen 634938908e pagemeta: Make BuildConfig.Render an enum
Allowing links on pages without rendering them.

Fixes #7783
2020-10-06 14:06:10 +02:00
Bjørn Erik Pedersen c63db7f1f6 Allow cascade to be a slice with a _target discriminator
Fixes #7782
2020-10-06 14:06:10 +02:00
Helder Pereira 8e553dcdef markup/asciidocext: Add preserveTOC option 2020-09-17 10:50:25 +02:00
Fernando Jorge Mota fb0f2cc718
markup/highlight: Add support to linkable line anchors on Chroma
Fixes #7622
2020-09-13 11:00:16 +02:00
Helder Pereira 6a848cbc3a markup/asciidocext: Fix AsciiDoc TOC with code
Fixes #7649
2020-09-10 21:53:13 +02:00
Bjørn Erik Pedersen b9e4f5898b
Merge commit '7d7771b673e5949f554515a2c236b23192c765c8' 2020-09-07 21:37:51 +02:00
Nicolas Piganeau 3ba7c92530 markup/asciidoc: Add support for .TableOfContents
Fill the .TableOfContents template variable when writing Asciidoc content.
This is done by letting Asciidoc render its TOC as HTML, then extract this
HTML rendered TOC, parse it into a tableofcontents.Root and finally remove
it from the HTML content.
This aims to stay in the logic that the Asciidoc parsing is entirely done
by the external helper.

See #1687
2020-09-06 11:34:32 +02:00
Bjørn Erik Pedersen f8b8b091fc
Merge commit 'cb39847dee488c373dd5bc2a3706385342a59355' 2020-08-14 18:31:40 +02:00
Helder Pereira 45c665d396
Fix Asciidoctor args
* Fix Asciidoctor args

* Fix Asciidoctor args documentation

* Update AsciiDoc documentation

Co-authored-by: Derk Muenchhausen <derk@muenchhausen.de>

Fixes #7493
2020-07-23 15:59:48 +02:00
Bjørn Erik Pedersen 5f7a65a080
Merge commit '823ce055ed3356da37e9ec4ac70446bdbbaa8de8' 2020-07-13 11:01:55 +02:00
Bjørn Erik Pedersen f1916f114b
Merge commit '6aa5c9117fd34644459ea9bcfb1b3f5010658d5d' 2020-07-07 07:00:01 +02:00
Bryan Klein e9f87c4e3f Update formats.md doc for new allowed extensions.
This PR documents the changes made in https://github.com/gohugoio/hugo/pull/7447/files adding two other extensions to the Allowed list.
2020-07-03 01:27:51 +02:00
Derk Muenchhausen f0266e2ef3
Rework external asciidoctor integration
This commit solves the relative path problem with asciidoctor tooling. An include will resolve relatively, so you can refer easily to files in the same folder.

Also `asciidoctor-diagram` and PlantUML rendering works now, because the created temporary files will be placed in the correct folder.

This patch covers just the Ruby version of asciidoctor. The old AsciiDoc CLI EOLs in Jan 2020, so this variant is removed from code.

The configuration is completely rewritten and now available in `config.toml` under the key `[markup.asciidocext]`:

```toml
[markup.asciidocext]
    extensions = ["asciidoctor-html5s", "asciidoctor-diagram"]
    workingFolderCurrent = true
    trace = true
    [markup.asciidocext.attributes]
        my-base-url = "https://example.com/"
        my-attribute-name = "my value"
```

- backends, safe-modes, and extensions are now whitelisted to the popular (ruby) extensions and valid values.
- the default for extensions is to not enable any, because they're all external dependencies so the build would break if the user didn't install them beforehand.
- the default backend is html5 because html5s is an external gem dependency.
- the default safe-mode is safe, explanations of the modes: https://asciidoctor.org/man/asciidoctor/
- the config is namespaced under asciidocext_config and the parser looks at asciidocext to allow a future native Go asciidoc.
- `uglyUrls=true` option and `--source` flag are supported
- `--destination` flag is required

Follow the updated documentation under `docs/content/en/content-management/formats.md`. 
  
This patch would be a breaking change, because you need to correct all your absolute include pathes to relative paths, so using relative paths must be configured explicitly by setting `workingFolderCurrent = true`.
2020-06-25 09:51:33 +02:00
Bjørn Erik Pedersen fc045e12a9 Rename taxonomy kinds from taxonomy to term, taxonomyTerm to taxonomy
And we have taken great measures to limit potential site breakage:

* For `disableKinds` and `outputs` we try to map from old to new values if possible, if not we print an ERROR that can be toggled off if not relevant.
* The layout lookup is mostly compatible with more options for the new `term` kind.

That leaves:

* Where queries in site.Pages using taxonomy/taxonomyTerm Kind values as filter.
* Other places where these kind value are used in the templates (classes etc.)

Fixes #6911
Fixes #7395
2020-06-18 09:09:56 +02:00
Bjørn Erik Pedersen 0a9172672a
Merge commit 'efa74c5c6e6ff1daddeb5834ea7c69bed2acf171' 2020-06-16 14:19:31 +02:00
Bjørn Erik Pedersen 626b16e024
Merge commit '9e1dcefc5f559944b70d2fa520f6acd5c56a69f2' 2020-05-31 12:43:33 +02:00
Bjørn Erik Pedersen e0e81b280f
Merge commit 'c9403cbceaaeff53ff4833561f4eefe1dc1a405e' 2020-05-18 15:25:26 +02:00