Releases: gunndabad/govuk-frontend-aspnetcore
v2.2.0
v2.1.0
v2.0.1
Targets GOV.UK Frontend v5.1.0.
New features
Page template
New overloads of GenerateScriptImports
and GenerateStyleImports
have been added that accept an appendVersion
parameter.
This appends a query string with a hash of the file's contents so that content changes following upgrades are seen by end users.
v2.0.0
Targets GOV.UK Frontend v5.1.0.
New features
GOV.UK Frontend hosting options
Previously the GOV.UK Frontend library's assets were always hosted at the root of the application.
Many applications generate their own CSS and/or JavaScript bundles and don't need the standard versions at all, though they likely still need the static assets (fonts, images etc.).
There are now two properties on GovUkFrontendOptions
to control the hosting of the static assets and the compiled assets - StaticAssetsContentPath
(default /assets
) and CompiledContentPath
(default /govuk
), respectively.
Applications that build and reference their own CSS and JavaScript can set CompiledContentPath
to null
to skip hosting the standard compiled assets. Similarly, setting StaticAssetsContentPath
to null
will skip hosting the static assets.
Page template
PageTemplateHelper
and the _GovUkPageTemplate.cshtml
view have been updated to respect the StaticAssetsContentPath
and CompiledContentPath
paths set on GovUkFrontendOptions
.
An additional ViewData
key can now be passed to _GovUkPageTemplate.cshtml
- AssetPath
. When specified, it will be used in place of the StaticAssetsContentPath
value from GovUkFrontendOptions
for referencing static asserts.
GovUkFrontendJsEnabledScript
, GovUkFrontendScriptImports
and GovUkFrontendStyleImports
extension methods have been added over IHtmlHelper
that wrap the
GenerateJsEnabledScript
, GovUkFrontendScriptImports
and GovUkFrontendStyleImports
methods on PageTemplateHelper
, respectively.
Tag helper changes
bool
tag helper properties have been changed to bool?
.
This is so that it's possible to differentiate between properties that have been explicitly initialized and those that have been left at the default values.
With this, other tag helpers or tag helper initializers can be created that assign default values to these properties.
Breaking changes
AddImportsToHtml
This option was used to automatically add style and JavaScript imports to all Razor views.
PageTemplateHelper
and the _GovUkPageTemplate.cshtml
layout view are better ways to generate a full page template now so this option, along with the backing tag helper component, have been removed.
Fixes
Page template
The og:image
meta
tag in the _GovUkPageTemplate.cshtml
view is now an absolute URL.
v2.0.0-alpha1
Targets GDS Frontend v5.1.0.
v1.5.0
v1.4.0
Targets GDS Frontend v4.7.0.
New features
Customize the text prepended to <title>
for pages that have errors
By default 'Error: ' is prepended to the <title>
element for pages that have errors. A new attribute - gfa-error-prefix
- has been added to TitleTagHelper
that allows for overriding this e.g. for localization purposes.
Inference of pages with errors is more consistent
Previously a page was deemed to have errors if there were errors inside ModelState
. That logic is now amended to look for the presence of an error summary component instead. A page can be explicitly set to have errors by calling ViewData.SetPageHasErrors(true)
.
Tag helpers can have their content overridden by other tag helpers
Tag helpers outside of this library can now modify the content of a govuk-*
tag helper and that change will be reflected in the generated output (it was previously ignored). Tag helpers that modify content need to have an Order
less than 0
for this to work.
id
attribute on buttons
<govuk-button>
and <govuk-button-link>
now have an id
attribute for setting the id
attribute on the generated button.
disabled
attribute on <govuk-file-upload>
<govuk-file-upload>
now has a disabled
attribute which sets the disabled
property on the generated <input>
.
v1.3.0
Targets GDS Frontend v4.6.0.
New features
novalidate
attribute is added to <form>
elements automatically
Following the guidance around disabling HTML5 validation a novalidate
attribute will be added to <form>
elements by default. This can be disabled by setting AddNovalidateAttributeToForms
on GovUkFrontendAspNetCoreOptions
to false
.
Date input components support month names
Following the guidance around accepting month names on date inputs both short and long month names are now accepted within Date input components by default. This can be disabled by setting AcceptMonthNamesInDateInputs
on GovUkFrontendAspNetCoreOptions
to false
.
v1.2.0
Targets GDS Frontend v4.5.0.
New features
<govuk-summary-card>
tag helper
See the documentation for the Summary list component for more information.
Thanks @sussexrick for the first draft!
v1.1.0
Targets GDS Frontend v4.4.1.
New features
The Accordion tag helper's show and hide text can be localised
See the hide-*
and show-*
attributes in the component docs for more information.
Label class can be specified on the outer tag helper
It's common to override the label's class for form components and nothing else. To avoid having to use a child tag helper for the label, a label-class
attribute is now available on all form components.
Before:
...
<govuk-input asp-for="...">
<govuk-input-label class="govuk-label--l" />
</govuk-input>
After:
...
<govuk-input asp-for="..." label-class="govuk-label--l" />