-
Notifications
You must be signed in to change notification settings - Fork 256
Fix FAQ schema text extraction and expand coverage #16214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
asafashirov
wants to merge
6
commits into
master
Choose a base branch
from
fix-faq-schema-text-field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
The FAQ structured data was generating empty answer text (just '\t\n\r') for all FAQ pages, causing Google Search Console validation errors. The issue was with Hugo's trim function when used in pipeline mode with the cutset ' \t\n\r' - it was returning the cutset itself instead of the trimmed text. Solution: Replace all instances of 'trim " \t\n\r"' with 'strings.TrimSpace' which properly trims whitespace characters. This fixes the 'Missing field "text" (in "mainEntity.acceptedAnswer")' error reported by Google Search Console.
Previously, FAQ schema was limited to 'docs' type pages with /faq in URL or 'faq' in title. This was too restrictive and missed valuable Q&A content. Changes: - Remove 'docs' type restriction to capture Q&A content anywhere - Add support for 'what-is' pages (41 pages with consistent Q&A format) - Add detection for pages with 'frequently asked' in title - Maintain support for existing FAQ pages This expansion allows FAQ structured data to appear on: - 5 existing FAQ pages (already working) - 41 what-is pages (newly added) - Any future pages with FAQ/Frequently Asked in title Benefits: - Better SEO with rich snippets for question-based searches - Improved discovery through Google's 'People also ask' features - Better machine readability for AI/LLM tools - More comprehensive Q&A coverage across the site
Previously, ALL H3 headers were treated as questions, causing non-question section headers to be incorrectly included in FAQ structured data. Changes: - In FAQ pages (/faq in URL): All H3s treated as questions (backward compatible) - In other pages: H3 must end with '?' to be a question - H2 questions still require '?' everywhere (unchanged) Results: - FAQ pages: No change, still extract all H3s (9-21 questions) - What-is IaC: Reduced from 12 to 4 questions (removed false positives) - What-is Secrets: Reduced from 38 to 18 questions (only real questions) This ensures FAQ schema only contains actual questions that users might search for, improving SEO quality and search engine understanding.
Deleted 9 unused schema templates: - course-entity.html collector (never referenced) - 8 legacy content schemas (article, blog, code, course, event, howto, product-software, qa) These files were part of old non-@graph schema implementation and are no longer used. All current schemas (BlogPosting, HowTo, FAQPage, TechArticle, etc.) continue to work correctly. Kept course-list.html as it's actively used by tutorials/section.html.
This comment was marked as resolved.
This comment was marked as resolved.
Changed from incorrect pipeline usage of trim to proper function call syntax. Hugo's trim function requires 2 arguments: the string and the cutset.
Replace all remaining strings.TrimSpace with trim function using proper Hugo syntax
Your site preview for commit f4291ae is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-16214-f4291ae1.s3-website.us-west-2.amazonaws.com. |
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
trim
function was being misused in pipeline modeChanges
trim
with proper function call syntax usingtrim $var \" \\t\\n\\r\"
(7 instances)?
Technical Details
The bug was caused by incorrect usage of Hugo's
trim
function. When used in pipeline mode with a cutset parameter, it was returning the cutset string itself ("\t\n\r") instead of the trimmed content. Fixed by using proper function call syntax:trim (expression) \" \\t\\n\\r\"
.