Repository navigation
fix: copy server-side section metadata, publish via helix-tools-website - #125
Merged
Merged
Conversation
Sites that process section metadata on the server (rendering version 2) no longer have a section-metadata block in the .plain.html, so Copy dropped it. Rebuild the Section Metadata table from the section's class, id and data attributes when there is no block, and leave the legacy path unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
dylandepass
force-pushed
the
fix/section-metadata-server-side
branch
from
October 6, 2026 20:42
4f786b7 to
5286b75
Compare
Open the release PR against adobe/helix-tools-website at the same tools/sidekick/library path, derive libraryHost from the library's own URL so plugins and locales load from wherever it is hosted, and point the README at tools.aem.live.
Chrome no longer matches :scope in shadow root queries, so query sp-sidenav directly. The test plugin host on hlx.live is now blocked, so load it from aem.live.
dylandepass
force-pushed
the
fix/section-metadata-server-side
branch
from
October 7, 2026 13:23
5286b75 to
2e88c57
Compare
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.
Copying a block from the blocks plugin dropped its Section Metadata on sites that process section metadata on the server (rendering version 2). This PR fixes that and changes where releases are published.
Section metadata
With rendering version 2, helix-html-pipeline applies the Section Metadata table to the section itself (
Stylebecomes classes,Idbecomes the id, everything else becomesdata-*) and removes thesection-metadatablock from the.plain.html. The blocks plugin only looked for asection-metadatablock, so there was nothing to copy.When there is no
section-metadatablock, copy now rebuilds the table from the section'sclass,idanddata-*attributes (getSectionMetadataFromAttributes). Asection-metadatablock is still preferred and handled as before. This covers block, default content, compound and multi-section block, and template copies.Rebuilt rows use the attribute name as the key (
section-margin, notSection Margin), and image and link values come back as absolute URLs. A round trip through helix-html-pipeline'sextractSectionMetadatareproduces the original class, id and data attributes.Hosting
adobe/helix-tools-website(sametools/sidekick/librarypath) instead ofadobe/helix-website.AppModel.libraryHostwas hardcoded tohttps://www.hlx.live/tools/sidekick/library, so loadingindex.jsfromtools.aem.livewould still have fetched the plugins and locales from the old copy. It is now derived from the URL the library was loaded from, so the plugins and locales always come from the same place asindex.js. When hosting the library yourself, host the whole directory (index.js,plugins/,locales/,events/,utils/).tools.aem.live. Existing installs keep working as long as the copy onwww.aem.liveandwww.hlx.livestays in place.Before the first release from this change,
Access-Control-Allow-Originneeds to be configured for/tools/sidekick/library/**on tools.aem.live.Tests
.plain.htmlfrom an affected site (testimonial-carousel.jsfixture), copying through both the block list and the details panel.libraryHost.24 tests in
blocks.test.jsand 2 infranklin-library.test.jsalready fail onmainwith a current Chrome. The 24 useshadowRoot.querySelector(':scope ...'), which no longer matches in shadow roots. This PR does not change that, and the new tests do not use that selector.