feat(tools): add DA plugin to generate FAQPage JSON-LD - #487
Draft
sdmcraft wants to merge 3 commits into
Draft
Conversation
Reads a page's .faq block content, merges a FAQPage node into the page's existing json-ld metadata @graph (idempotent by @type), and offers copy-to-clipboard for the author to paste into the Metadata block themselves -- no direct write-back to the document, avoiding any conflict with an open live-editing session. Fixes #486
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
A literal null byte had ended up in the template literal on the
dedup key line, making git/GitHub treat the file as binary
("Binary file not shown" in the PR diff). Replaced with a space;
no functional change, re-verified extraction still works.
Reference implementation to port from for the plugin's planned BreadcrumbList extractor module (see #486 discussion): depth-by-page-type rules, label derivation (title-segment + slug fallback), dead-link-crumb avoidance for pseudo-category pages, and merge-by-@type behavior. Ported from the batch/Node version to run against a local content/ clone; the plugin's browser/DA-Source-API context will need its own I/O layer around the same extraction logic. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
usman-khalid
force-pushed
the
main
branch
2 times, most recently
from
August 19, 2026 18:21
40a49bf to
0a53fdd
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.
Summary
Adds a DA library plugin (
tools/plugins/json-ld-schema/) that reads a page's.faqblock content and generatesFAQPageJSON-LD for the author to copy to clipboard and paste into the page'sjson-ldmetadata row.Grew out of the manual FAQPage JSON-LD work done across #451/#484/#485 — this makes that workflow self-serve instead of requiring an engineer to hand-generate it per page. Full plan, decisions, and prior-art review logged in #486.
.faq-classed block (variant classes likefaq cmpincluded), de-duplicating exact repeats and flattening multi-paragraph/list answers with word-boundary-safe joins (avoids the "answers run together" bug hit in a previous code-level attempt, PR feat(seo): add dynamic JSON-LD (BreadcrumbList + FAQPage) #472).FAQPagenode into any existingjson-ldmetadata@graphby@type— verified idempotent (re-running doesn't duplicate nodes).@idin order: existingWebPagenode in the page's ownjson-ld→ a plaincanonical/urlmetadata key → the currentaem.pageURL.Reuses
parseMetadata(),buildSourceUrl(),buildPageUrl(), andpick()from an external reference plugin (usman-khalid/da-playground/tools/json-ld-generator); FAQ extraction and@graphmerge logic are new, ported from the Python script used to fix #451/#484.Verification
content/index.html— correctly parsed its existing 5-node@graph, resolved@idtohttps://erp.intuit.com/, and produced the same 5-node output on a second pass (no duplication).json-ldcase produces the plain (non-@graph) object format used across all 40 pages from SEO : JSON-LD : Add FAQPage JSON-LD schema (homepage — content already exists, schema is missing) #451/SEO : JSON-LD : Add FAQPage JSON-LD schema to remaining 41 pages with .faq blocks (follow-up to #451) #484.eslint(airbnb-base) andstylelintboth pass clean.libraryconfig sheet before it can be opened from the Library panel, and that registration requires DA site-admin permissions this session doesn't have (see Tooling: DA plugin to generate FAQPage JSON-LD and copy to clipboard #486 discussion). Marking as draft until that's confirmed working end-to-end.Test plan
libraryconfig sheet (title: JSON-LD Schema,path: /tools/plugins/json-ld-schema/json-ld-schema.html,experience: dialog) — needs a DA org admin.faqblock in the DA editor, launch the plugin from the Library panel, confirm the preview UI rendersjson-ldmerges rather than duplicatesCloses #486