-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the table of content for room versions #1884
Conversation
Like for the cs-module shortcode, use .RenderShortcodes instead of .Content for the rver-fragment shortcode, so the headings are detected by Hugo. Signed-off-by: Kévin Commaille <[email protected]>
…shortcodes Now that we use .RenderShortcodes in the rver-fragment shortcode, we cannot remove the output of these shortcodes dynamically because they are replaced by a temporary placeholder due to Hugo's internals. Instead, since the `this` parameter was only used for room version, we always use the `v` parameter and compare with the version provided in the page's front matter. Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
https://spec.matrix.org/unstable/rooms/v11/ (and others) appear to be working fine right now. Is there a place where we can see the bug? |
oh my. That's dangerous. Ideally we'd have CI for this, but that's not a problem for this PR to solve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm
Signed-off-by: Kévin Commaille <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We need to use
.RenderShortcodes
for room version pages like in #1851, otherwise the headings in the included fragments are not present in the ToC of the page.However, that breaks the
withVersioning
trick, because the output we get has shortcodes replaced by temporary opaque strings, so we cannot detect them to remove them. The solution I found is to use a page parameter in theadded-in
andchanged-in
shortcodes to detect if the current version is the same as thev
parameter, since it seems to be the only way to pass a variable from the rendered page to the shortcode in the fragment.Pull Request Checklist
Preview: https://pr1884--matrix-spec-previews.netlify.app