Unit 13: shortcodes + render hooks modernization (Store, render-image, render-heading)#15
Open
stradichenko wants to merge 1 commit intomainfrom
Open
Unit 13: shortcodes + render hooks modernization (Store, render-image, render-heading)#15stradichenko wants to merge 1 commit intomainfrom
stradichenko wants to merge 1 commit intomainfrom
Conversation
- shortcodes/cite.html: replace .Page.Scratch.Get/Set with
.Page.Store.Get/Set (Hugo 0.85+, well below the 0.136 floor).
Refactor printf | safeHTML HTML construction into a dict + inline
template partial for cleaner escaping.
- shortcodes/sidenote.html: same Scratch -> Store, same printf refactor.
- _markup/render-inline.html and render-paragraph.html: drop blanket
safeHTML; the trust assumption is now documented.
- _markup/render-link.html: simplify; rely on the render-hook context
for resolved URLs instead of manually prepending BaseURL.
- NEW _markup/render-image.html: emit <img loading=lazy decoding=async>
with responsive srcset via images.Process / Resize when the image is
a Page Resource, plus width / height from image metadata.
- NEW _markup/render-heading.html: emit <h{N} id="..."> with an anchor
link (¶) and aria-label.
- recent-posts-grid.html: replace hardcoded ("Type" "posts") filter
with site.RegularPages "Section" "in" site.Params.mainSections
(defaulted to slice "posts").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shortcodes/cite.html: replace.Page.Scratch.Get/Setwith.Page.Store.Get/Set(Hugo 0.85+, well below the 0.136 floor). Refactorprintf | safeHTMLHTML construction into adict+ inline template partial for cleaner escaping.shortcodes/sidenote.html: sameScratch→Store, sameprintfrefactor._markup/render-inline.htmlandrender-paragraph.html: drop blanketsafeHTML; the trust assumption is now documented._markup/render-link.html: simplify; rely on the render-hook context for resolved URLs instead of manually prependingBaseURL._markup/render-image.html: emit<img loading=lazy decoding=async>with responsivesrcsetviaimages.Process/Resizewhen the image is a Page Resource, pluswidth/heightfrom image metadata._markup/render-heading.html: emit<h{N} id="...">with an anchor link (¶) andaria-label.recent-posts-grid.html: replace hardcoded("Type" "posts")filter withsite.RegularPages "Section" "in" site.Params.mainSections(defaulted toslice "posts").Test plan
citeandsidenoteshortcodes still produce identical output.mainSectionsconfig.Part of the PKB-theme modernization batch (15 units).