digitalnsw / nsw-design-system

The NSW Design System is a toolkit of style, patterns, standards and guidance for everyone creating distinctly NSW digital products and services. It helps us create unified, trusted, inclusive and audience centered digital experiences for our users that are clearly simple, current and purposeful.
https://digitalnsw.github.io/nsw-design-system/
MIT License
57 stars 28 forks source link

Would you consider providing twig versions of templates alongside the handlebars versions #427

Closed larowlan closed 1 month ago

larowlan commented 3 months ago

Is your feature request related to a problem? Please describe. A lot of NSW goverment sites make use of Drupal for their CMS. Drupal uses Twig for its templating system. This means that many sites are copying the .hbs files and converting them to twig. This however means when a new version of the design system is released, in order to update - those sites need to audit changes to the .hbs files and replicate them into their twig files.

Describe the solution you'd like Provide twig versions of the .hbs files directly alongside. It should be possible to create a build step to validate that the two are in sync. There is a JS version of Twig that could be used to compare the output against the equivalent .hbs version.

Describe alternatives you've considered We've considered keeping a hash of the .hbs file we forked from and doing the comparison when we update to the newest version of the design system.

Additional context

larowlan commented 3 months ago

FWIW with Twig you could also use vite-plugin-twig-drupal and Storybook for documenting your stories

oisa commented 3 months ago

Hey Lee,

Thanks so much for submitting your request. I've added it to our list to review for future versions of the DS - we're constantly looking for ways to hook into the stacks of our customers.

While I can't promise it'll be actioned, I can confirm (as you allude to) it does hold a lot of weight since a large percentage of our customers use Drupal so would benefit many in this respect. This will serve the piece of work as we discern what to work on next.

Upon beginning this piece of work, we'll be in touch if you are open to it.

Kind regards,

NSW DS team

larowlan commented 3 months ago

I'm interested in helping fwiw.