Problem/Motivation

Documentation URL are currently in description properties:

accordion:
  label: Accordion
  description: Used to condense space by hiding content and revealing it as needed. https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/accordeon
  category: Accordion

Proposed resolution

Move them to own "link" property:

accordion:
  label: Accordion
  description: Used to condense space by hiding content and revealing it as needed.
  links:
    - https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/accordeon
  category: Accordion

Don't forget to run prettier on modified YAML

And add related markup in patterns-meta-information.html.twig

You can tale inspiration from https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/templ... :

  {# External documentation links. #}
  {% if pattern.render_links %}
    <p>
      {% for renderLink in pattern.render_links %}
        {{ renderLink|add_class('btn btn-sm btn-primary') }}
      {% endfor %}
    </p>
  {% endif %}

with DSFR classes instead of Bootstrap classes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Title: [1.0.1] Move documentatiuon URL to own definition property » [1.0.1] Move documentation URLs to own definition property
musa.thomas’s picture

Assigned: Unassigned » musa.thomas

musa.thomas’s picture

Assigned: musa.thomas » Unassigned
Status: Active » Needs review
pdureau’s picture

Assigned: Unassigned » pdureau
Status: Needs review » Needs work

Thanks you.

I will do a few changes however.

No need to put this for every components because it is not specific to each link:

    - url: 'https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/accordeon'
      title: 'Accordeon documentation'
      options:
        attributes:
          target: '_blank'
          rel: "noopener external"

It belongs to the template.

  • pdureau committed 6f89f5dd on 1.0.x authored by Musa.thomas
    Issue #3459505 by Musa.thomas, pdureau: Move documentation URLs to own...
pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Fixed
pdureau’s picture

Status: Fixed » Closed (fixed)