You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently added .Fragments to the page object. What I'm describing in this issue is a known limitation, to me anyway, but I suspect that this new object will be used enough (to build ToC, to enable auditing of duplicate identifiers, bad links etc.) that there will be enough surprises to warrant fixing this.
As of writing this issue, this and variations of this (including using the .Related method when having a fragments type of index configured) will fail from a render hook template:
This also speeds up situations where you only need the fragments/toc and not the rendered content, e.g. Related
with fragments type indexing:
```bash
name old time/op new time/op delta
RelatedSite-10 12.3ms ± 2% 10.7ms ± 1% -12.95% (p=0.029 n=4+4)
name old alloc/op new alloc/op delta
RelatedSite-10 38.6MB ± 0% 38.2MB ± 0% -1.08% (p=0.029 n=4+4)
name old allocs/op new allocs/op delta
RelatedSite-10 117k ± 0% 115k ± 0% -1.36% (p=0.029 n=4+4)
```
Fixesgohugoio#10750
This also speeds up situations where you only need the fragments/toc and not the rendered content, e.g. Related
with fragments type indexing:
```bash
name old time/op new time/op delta
RelatedSite-10 12.3ms ± 2% 10.7ms ± 1% -12.95% (p=0.029 n=4+4)
name old alloc/op new alloc/op delta
RelatedSite-10 38.6MB ± 0% 38.2MB ± 0% -1.08% (p=0.029 n=4+4)
name old allocs/op new allocs/op delta
RelatedSite-10 117k ± 0% 115k ± 0% -1.36% (p=0.029 n=4+4)
```
Fixes#10750
I recently added
.Fragments
to the page object. What I'm describing in this issue is a known limitation, to me anyway, but I suspect that this new object will be used enough (to build ToC, to enable auditing of duplicate identifiers, bad links etc.) that there will be enough surprises to warrant fixing this.As of writing this issue, this and variations of this (including using the
.Related
method when having afragments
type of index configured) will fail from a render hook template:The above will currently create a "bite your own tail" situation.
Luckily, Goldmark allows us to split parsing and rendering, so I will fix this.
A quick semi-related note about shortcodes at the end. To do something similar in shortcodes you need to use the
{{<
delimiter, e.g:The reason for this is that the
{{%
inner content will be evaluated before we hand it to Goldmark to parse as Markdown./cc @jmooring
The text was updated successfully, but these errors were encountered: