Skip to content

Add sitemap / list of patterns endpoints #191

Open
@thibaudcolas

Description

@thibaudcolas

Is your proposal related to a problem?

There are two use cases we’ve run across where having a list of all the patterns within a project would be helpful:

  • For integration with Pa11y CI, to test all of the project’s patterns at once. It expects a sitemap, and has configuration to then ignore some of the entries.
  • For API usage with our new API rendering endpoint, to create a listing similarly to what the pattern library UI does

Describe the solution you'd like

  • One sitemap.xml URL with an XML sitemap
  • One custom API endpoint with the same nested patterns structure as in the UI

Describe alternatives you've considered

@jhancock532 shared with me his sitemap generator. I have created a custom API endpoint on my own.

Additional context

The logic to get the list / tree of patterns is here: https://github.com/torchbox/django-pattern-library/blob/main/pattern_library/utils.py#L82.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions