Features
Add extra features to help users browse your site.
The NHS.UK Eleventy Plugin makes it easy to add common website features and pages. Choose from:
-
404 page not found – Inform readers if a page is not found.
-
RSS feed – Allow readers to subscribe to posts in their feed reader.
-
Search – Make it easier for readers to search for content on your site.
-
Sitemap – Help readers find content on your site.
-
Tags – Allow readers to browse content by using tags to categorise posts.
Note:
If you have pages that write to the same location as a feature, these will take precedence over any pages generated by a feature template.
Turn off the 404 error page and sitemap
The plugin creates 404 page not found and sitemap pages by default. You can turn these off by setting their options to false
:
import { nhsukEleventyPlugin } from '@x-govuk/nhsuk-eleventy-plugin'
export default function(eleventyConfig) {
// Register and configure the plugin
eleventyConfig.addPlugin(nhsukEleventyPlugin, {
templates: {
error404: false,
sitemap: false
}
})
return {
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
input: 'docs',
}
}
};