FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

The manual comma handling for the `sameAs` array is brittle and hard to maintain · Issue #498 · NextCommunity/NextCommunity.github.io · GitHub

The manual comma handling for the sameAs array is brittle and hard to maintain #498

Description

The manual comma handling for the sameAs array is brittle and hard to maintain if more social links are added in the future. Using Nunjucks' built-in joiner utility provides a much cleaner and more idiomatic way to handle delimiters in conditional blocks.

  "sameAs": [
    {%- set comma = joiner(",") -%}
    {%- if seo.person.github -%}{{ comma() }}{{ ("https://github.com/" + seo.person.github) | safeJsonLd | safe }}{%- endif -%}
    {%- if seo.person.linkedin -%}{{ comma() }}{{ seo.person.linkedin | safeJsonLd | safe }}{%- endif -%}
  ]

Originally posted by @gemini-code-assist[bot] in #494

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    To do

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL