Skip to content

Switch to .Page.RenderString instead of markdownify in note shortcode (Issue #17)

Sarah Crowle requested to merge note-shortcode-fix into main

Why is this change being made?

See issue #17 (closed). Relative links to headings (like this: [some text](#link-here)) inside shortcodes (such as {{% note %}}) are broken, and link to the handbook.gitlab.com home page instead.

This is due to a known Hugo issue where the markdownify function is known to be broken when render hooks are involved, as markdownify ALWAYS uses the home page to resolve all resources (including, apparently, expanding anchors): https://github.com/gohugoio/hugo/issues/9692.

Changing the note shortcode implementation to use .Page.RenderString instead seems to solve the issue in this case. I'm marking this MR as a draft, because I'm not 100% sure of the implications of this change, and I'm somewhat new to Hugo.

  • Draft: Switch to .Page.RenderString instead of markdownify (Issue #17 (closed))

Author and Reviewer Checklist

Please verify the check list and ensure to tick them off before the MR is merged.

  • Confirmed that this update should be in the internal handbook rather than public handbook, per the SAFE framework
  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
    • If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the Maintained by section on the page being edited
    • If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
    • The when to get approval handbook section explains the workflow in more detail
  • For transparency, share this MR with the audience that will be impacted.
    • Team: For changes that affect your direct team, share in your group Slack channel
    • Department: If the update affects your department, share the MR in your department Slack channel
    • Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR

Merge request reports