Skip to content

WIP: Add links to rebranded code examples#4630

Closed
domoscargin wants to merge 8 commits into
bk-presenting-branded-examplesfrom
bk-presenting-branded-code
Closed

WIP: Add links to rebranded code examples#4630
domoscargin wants to merge 8 commits into
bk-presenting-branded-examplesfrom
bk-presenting-branded-code

Conversation

@domoscargin
Copy link
Copy Markdown
Contributor

@domoscargin domoscargin commented Apr 14, 2025

What

Adding a rebrand: true frontmatter property to any code example will (during build):

  • Duplicate that file before running Metalsmith/in-place, renaming it from index.njk to branded.njk
  • Change the layout property for that file to point at the branded/ subdirectory, to take advantage of {% set govukRebrand = true %} (potentially this could be automated as well, so we don't need to manually duplicate/maintain the layout files either)
  • Run a custom jsTransformer on the nunjucks which inserts rebrand: true into govukHeader and govukFooter macro calls
  • Saves the file to [type]/[title]/[example]/branded/index.html (eg: components/header/default/branded/index.html)

To do

  • In the first instance, hopefully we'll have access to a Nunjucks global in order to make this a lot simpler, but in case that doesn't happen for a while, we can work with this.
  • Add the property to each relevant file
  • Create/update the brand tag/note macro which will link out to these examples
  • Potentially automate the layout transform as well
  • Document and test

Future

It should be relatively easy to swap all the "branded", "rebrand" naming for something like "legacy" or whatever we want to call our current styles when we eventually default to the rebrand styles.

There's still some repeated content in the branding wording which might be able to be made reusable
@domoscargin domoscargin changed the title Add links to rebranded code examples WIP: Add links to rebranded code examples Apr 14, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 14, 2025

You can preview this change here:

Name Link
🔨 Latest commit 95e67c8
🔍 Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/67ffc97e918a1e0008a75f5e
😎 Deploy Preview https://deploy-preview-4630--govuk-design-system-preview.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.

@domoscargin domoscargin force-pushed the bk-presenting-branded-code branch from fdf48ce to 611a42d Compare April 14, 2025 15:44
@domoscargin domoscargin force-pushed the bk-presenting-branded-code branch from 611a42d to 95e67c8 Compare April 16, 2025 15:15
@domoscargin domoscargin force-pushed the bk-presenting-branded-examples branch 2 times, most recently from 98cafea to 362edcc Compare April 16, 2025 15:20
@domoscargin domoscargin deleted the bk-presenting-branded-code branch April 16, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant