Skip to content
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

Merging to release-5.7: [DX-1841] added modified date to the structured data script (#6033) #6041

Merged

Conversation

buger
Copy link
Member

@buger buger commented Feb 28, 2025

User description

DX-1841 added modified date to the structured data script (#6033)

  • added modified date to the structured data script

PR Type

  • Enhancement

Description

  • Updated JSON-LD @context and mainEntityOfPage formatting.

  • Converted author and copyrightHolder to organization objects.

  • Added datePublished and dateModified fields.

  • Enhanced overall schema.org compliance.


Changes walkthrough 📝

Relevant files
Enhancement
site_schema.html
Update JSON-LD structured data script.                                     

tyk-docs/themes/tykio/layouts/partials/site_schema.html

  • Switched "@context" URL to HTTPS.
  • Reformatted mainEntityOfPage using printf.
  • Converted author and copyrightHolder strings to organization objects.
  • Added datePublished and dateModified properties.
  • +19/-12 

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • * added modified date to the structured data script
    
    (cherry picked from commit e816005)
    @buger buger enabled auto-merge (squash) February 28, 2025 12:06
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    6033 - PR Code Verified

    Compliant requirements:

    • JSON-LD @context update
    • Author and copyrightHolder as organization objects
    • Inclusion of datePublished and dateModified fields

    Requires further human verification:

    • Verify that templated dynamic fields (e.g., url and keywords) render as valid JSON strings
    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    JSON Output Validation

    Check that dynamic fields (such as url and keywords) are correctly formatted as JSON strings upon rendering. Ensure no syntax issues arise from missing quotation marks in templated outputs.

    "url": {{ .Permalink | printf "%s" }},
    "keywords": [{{ if isset .Params "tags" }}{{ range $index, $tag := .Params.tags }}"{{ $tag }}"{{ if ne $index (sub (len $.Params.tags) 1) }},{{ end }}{{ end }}{{ end }}],
    "datePublished": "{{ .Date.Format "2006-01-02" }}",
    "dateModified": "{{ .Lastmod.Format "2006-01-02" }}"

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Quote templated @id

    Wrap the @id template output in quotes to ensure the generated JSON is valid.

    tyk-docs/themes/tykio/layouts/partials/site_schema.html [7]

    -"@id": {{ .Site.BaseURL | printf "%s" }}
    +"@id": "{{ .Site.BaseURL | printf "%s" }}"
    Suggestion importance[1-10]: 8

    __

    Why: Wrapping the @id output in quotes ensures the generated JSON is valid. This change is crucial for proper JSON formatting.

    Medium
    Quote templated url

    Wrap the url template output in quotes to maintain proper JSON string formatting.

    tyk-docs/themes/tykio/layouts/partials/site_schema.html [21]

    -"url": {{ .Permalink | printf "%s" }},
    +"url": "{{ .Permalink | printf "%s" }}",
    Suggestion importance[1-10]: 8

    __

    Why: Enclosing the url output in quotes is necessary to maintain proper JSON string formatting, ensuring schema consistency.

    Medium

    Copy link

    netlify bot commented Feb 28, 2025

    PS. Pls add /docs/nightly to the end of url

    Name Link
    🔨 Latest commit f35ad99
    🔍 Latest deploy log https://app.netlify.com/sites/tyk-docs/deploys/67c1a6e057bb930008d9be24
    😎 Deploy Preview https://deploy-preview-6041--tyk-docs.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    @buger buger merged commit ad4e778 into release-5.7 Feb 28, 2025
    9 checks passed
    @buger buger deleted the merge/release-5.7/e8160056480b929161d92651cf41ef12b24d74f5 branch February 28, 2025 12:09
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants