-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it easier to set a page title #2030
Conversation
b97aed8
to
5b6afdb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! I'm not actually sure which of the many dash characters should be used, but GOV.UK seems to use -
(hyphen-minus)? Probably an —
(em dash) would look better, but maybe there’s a reason not to use this? 🤷
As a follow-up PR, we could set the title
variable on the example template pages, and then re-use the title within the h1s?
@@ -10,7 +10,7 @@ | |||
{% endblock %} | |||
|
|||
{% block pageTitle %} | |||
GOV.UK Prototype Kit | |||
{% if title %}{{ title }} - {% endif %}{{ serviceName }} - {% if titleOrganisation %}{{ titleOrganisation }}{% else %}GOV.UK Prototype Kit{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not actually sure if titleOrganisation
is needed? I've not seen anyone use that format and it’s not mentioned in the title style guide - but maybe you know of some instances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I put that in is because we use - GOV.UK Prototype Kit
and your example was - GOV.UK
.
I took that to mean that you want titles in your prototype to end with - GOV.UK
but I don't think we can recommend that as a default, so in your kit you can set titleOrganisation = "GOV.UK"
and get the behaviour that was in your PR before I messed with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I fixed the dash to match what's on the style guide (probably what we were already using).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t that still result in Section name - GOV.UK - GOV.UK Prototype Kit
though? I think we’d want to use Section name - service name - GOV.UK
, as per the style guide?
Is there any reason not to switch out GOV.UK Prototype Kit
for GOV.UK
as the hardcoded bit at the end? The prototypes are password-protected, and otherwise look and feel exactly like a real service, so I don't see any issues around accidentally misleading people?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I misread the syntax! 🤦🏻♂️
I still think you could default to just - GOV.UK
but it’s not a big deal.
Would also suggest renaming the variable to titleSuffix
to be more generic, as I don’t think it’s generally recommended to include the organisation (eg department) name in the title?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree the default should be GOV.UK as per our guidelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to drop org/suffix - this is the govuk branded template - the default should be GOV.UK. If we find use cases to change it we can investigate adding suffix then
5b6afdb
to
1e86ae0
Compare
848c33b
to
5dd85c2
Compare
5dd85c2
to
acf8ead
Compare
🙌🏻 |
@frankieroberto contributed a PR for this with the comment "One possible implementation for #1975."
I have taken that PR, added tests and changed the behaviour slightly. It now works as follows:
pageTitle
block (as we have recommended so far) which gives you full control over the page title.pageName
variable and thetitle
will have- <serviceName> - GOV.UK
added to the end of itNext steps: