Commit graph

17 commits

Author SHA1 Message Date
Bjørn Erik Pedersen cedd04db31
docs: Fix related docs example 2023-02-23 10:54:30 +01:00
Bjørn Erik Pedersen 90da7664bf Add page fragments support to Related
The main topic of this commit is that you can now index fragments (content heading identifiers) when calling `.Related`.

You can do this by:

* Configure one or more indices with type `fragments`
* The name of those index configurations maps to an (optional) front matter slice with fragment references. This allows you to link
page<->fragment and page<->page.
* This also will index all the fragments (heading identifiers) of the pages.

It's also possible to use type `fragments` indices in shortcode, e.g.:

```
{{ $related := site.RegularPages.Related .Page }}
```

But, and this is important, you need to include the shortcode using the `{{<` delimiter. Not doing so will create infinite loops and timeouts.

This commit also:

* Adds two new methods to Page: Fragments (can also be used to build ToC) and HeadingsFiltered (this is only used in Related Content with
index type `fragments` and `enableFilter` set to true.
* Consolidates all `.Related*` methods into one, which takes either a `Page` or an options map as its only argument.
* Add `context.Context` to all of the content related Page API. Turns out it wasn't strictly needed for this particular feature, but it will
soon become usefil, e.g. in #9339.

Closes #10711
Updates #9339
Updates #10725
2023-02-21 17:56:41 +01:00
Bjørn Erik Pedersen f04cc581e1
Merge commit '00c4484c7092181729f6f470805bc7d72e8ad17b' 2022-11-17 16:16:19 +01:00
Bjørn Erik Pedersen d7497b28c1
Merge commit 'd276e901b36d2576ef8350ed96b17f66254eac1b' 2022-03-26 11:04:57 +02: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 d7b22aee46
Merge commit 'c239c643fee10bfa217cb108755b798f8f5f3b10' 2021-05-01 11:45:45 +02:00
Bjørn Erik Pedersen a1a9f088b1
Merge commit 'e48ffb763572814a3788780bb9653dfa2daeae22' 2021-01-20 12:48:39 +01:00
Bjørn Erik Pedersen f8b8b091fc
Merge commit 'cb39847dee488c373dd5bc2a3706385342a59355' 2020-08-14 18:31:40 +02:00
Bjørn Erik Pedersen 79355043e8
Merge commit 'efc0b1bb6c6564f54d596467dbc6a18cb206954e' 2019-11-11 11:46:22 +01:00
Bjørn Erik Pedersen 27aef3f1fb Merge commit 'b9bd35d72e14932fb6588ff62b90cddef0a060fc' as 'docs' 2019-10-21 10:22:28 +02:00
Bjørn Erik Pedersen 39121de4d9
docs: Replace /docs 2019-10-21 10:21:51 +02:00
Bjørn Erik Pedersen 05d0eddd2b
Merge commit '35febb2e2a3780c3338a2665fddea7dda28a17f4' 2019-07-15 23:50:56 +02:00
Bjørn Erik Pedersen 4b2738d871
Merge commit '74309fe5699a595080fdb3a14711e0869babce99' 2018-10-29 09:23:25 +01:00
Bjørn Erik Pedersen b7ca3e1b3a
Merge commit '13e64d72763bf8d6d92d4cdfc15ed45ee9debfab' 2018-09-14 08:35:23 +02:00
Bjørn Erik Pedersen 59ebc83d72
Merge commit 'b6b37a1f00f808f3c0d2715f65ca2d3091f36495' 2018-07-18 11:05:58 +02:00
Bjørn Erik Pedersen 7b9dbef41a
Merge commit 'd2b1030060d3c91d5f9ffa3456418da16bd74f1d' 2018-05-25 15:05:23 +02:00
Bjørn Erik Pedersen 914cc85e22
Merge commit '83bef6955e014d40c0f00db9cebe09113154e999' 2018-05-04 09:44:59 +02:00