Adding automatically generated & pushed FAQ JSON-LD schema feature to accordion - #199
Draft
JonBarakMierke wants to merge 3 commits into
Draft
Adding automatically generated & pushed FAQ JSON-LD schema feature to accordion#199JonBarakMierke wants to merge 3 commits into
JonBarakMierke wants to merge 3 commits into
Conversation
JonBarakMierke
marked this pull request as draft
August 17, 2026 21:45
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 faq boolean attribute to <x-ui.accordion>.
When present, the component parses its rendered items and automatically builds a FAQPage JSON-LD schema, then pushes it onto Laravel's head stack via @Push('head').
Each accordion item's trigger text becomes a Question, and its content panel's markup becomes the corresponding Answer.
Items with an empty trigger or empty content are silently skipped rather than emitted as blank entries.
No new dependencies — extraction uses PHP's built-in DOMDocument/DOMXPath, consistent with the library's zero-dependency, copy-paste philosophy.
</ sequences in answer HTML are escaped to prevent breaking out of the <script> tag.
Usage
Consumers need @stack('head') declared in their layout's for the schema to be emitted — this is documented in usage.md