Options
Customise the appearance and behaviour of your website.
You can add options to the second parameter of the addPlugin
function in Eleventy config file.
For example, to add a product name to the right of the GOV.UK text in the header, you would add the following:
import { govukEleventyPlugin } from '@x-govuk/govuk-eleventy-plugin'
export default function(eleventyConfig) {
eleventyConfig.addPlugin(govukEleventyPlugin, {
header: {
productName: 'Apply for a juggling licence',
}
})
}
Name | Type | Description |
---|---|---|
icons | object | Override GOV.UK icons. |
icons.mask | string|boolean | Override GOV.UK SVG mask icon. Use `false` to not include a mask icon. |
icons.shortcut | string|boolean | Override GOV.UK favicon. Use `false` to not include a favicon. |
icons.touch | string|boolean | Override GOV.UK touch icon. Use |
opengraphImageUrl | string | URL for default Open Graph share image. |
headingPermalinks | boolean | Add links to headings, making it easier to share sections of a page (default is |
homeKey | string | First item in pagination and key to use when referring to the home page for |
parentSite | object | Website to show as first item in breadcrumbs. |
parentSite.url | string | URL for parent site. |
parentSite.name | string | Name of parent site. |
rebrand | boolean | Use GOV.UK rebrand (default is |
showBreadcrumbs | boolean | Show breadcrumb navigation (default is |
stylesheets | Array | Additional stylesheets to load after application styles. |
themeColor | string | Browser theme colour. Must be a hex value, i.e. |
titleSuffix | string or boolean | Value to show at the end of the document title (default is |
url | string | The URL of your website. Optional, but required to have valid canonical URLs in Open Graph meta data. |
header | object | See header options. |
serviceNavigation | object | |
footer | object | See footer options. |
Header options
In addition to the options available for the header component, the following options can be set for header
:
Name | Type | Description |
---|---|---|
homepageUrl | string | URL organisation name is linked to (default is |
logotype | object | Logo that appears in the header. If no value is provided, the GOV.UK logo is shown. |
logotype.text | string | Text to show instead of the GOV.UK logo. This text will appear bold. If |
logotype.html | string | If |
productName | string | Product name that appears after the organisation name (default is |
search | object | See search options. |
Service navigation options
In addition to the options available for the service navigation component, the following options can be set for serviceNavigation
:
Name | Type | Description |
---|---|---|
search | object | Injects search field into |
Search options
You can show a search field in your site header, or within the service navigation (if enabled).
Follow guidance in the GOV.UK Design System about adding other header and navigation elements to decide which is the best location to use.
Name | Type | Description |
---|---|---|
label | string | Text to show in the search field (default is ‘Search site’). |
indexPath | string | Path to search index file. |
sitemapPath | string | Path to sitemap page, shown as a fallback if the search field cannot be displayed. |
Footer options
In addition to the options available for the footer component, the following options can be set for footer
:
Name | Type | Description |
---|---|---|
contentLicence | object | Licence description. If no value is provided, the OGL logo is shown alongside the words |
contentLicence.text | string | If |
contentLicence.html | string | If |
copyright | object | Copyright statement. If no value is provided, |
copyright.text | string | If |
copyright.html | string | If |
logo | boolean | Show logo in rebranded footer (default is |