Open 36degrees opened 4 years ago
Making the change itself is easy. Understanding how we want teams to use the header and in which circumstances is more complex.
As a local authority, consuming the npm module, we're at this point (needing to remove / replace icons and fonts) before we can start testing our first service internally. Looking at macro-options.json for the header component I don't immediately spot an option that would let us change the embedded govuk-header__logotype-crown svg via a param.
Is there something I'm missing or are we best forking the header component and making the changes we need in our own project?
@DevRCRun yes you're correct, for now you can't do that with the Nunjucks macro and will need to use HTML directly instead.
I'm developing a Flask app.
I'm using govukHeader
and modifying the package directly at ./node_modules/govuk-frontend/dist/govuk/components/header/template.njk
replacing logo SVG, however the changes are not getting reflected after flask restart.
Any tips on what am I missing to get GOV.UK replaced with another logo? cc @NickColley
@Dlozitskiy Is your Flask app loading our Nunjucks template directly? I would have thought Python apps would rely on Jinja templates (like this port of GOV.UK Frontend), as Nunjucks is a templating engine for JavaScript (although its syntax is taken from Jinja). If you're using govuk-frontend-jinja
for your templates, it would be this template you need to edit instead of the one in node_modules/govuk-frontend
.
Thank you @romaricpascal, that was indeed the case, had to modify /opt/venv/lib/python3.11/site-packages/govuk_frontend_jinja/templates/components/header/macro.html
As per https://github.com/alphagov/govuk-design-system-backlog/issues/97#issuecomment-552755688: