Skip to content

Commit

Permalink
Code style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto committed Dec 6, 2023
1 parent 2c708b2 commit 3f167d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const govukEleventyPlugin = require('@x-govuk/govuk-eleventy-plugin')
const fs = require('fs')
const matter = require('gray-matter')

module.exports = function(eleventyConfig) {
module.exports = function (eleventyConfig) {
// Register the plugin
eleventyConfig.addPlugin(govukEleventyPlugin, {
brandColour: '#28a',
Expand Down Expand Up @@ -47,13 +47,13 @@ module.exports = function(eleventyConfig) {
// code, and there’s currently no built-in way to fetch it un-rendered.
//
// See https://github.com/mozilla/nunjucks/issues/788
eleventyConfig.addNunjucksGlobal("getNunjucksCode", function(componentName) {
eleventyConfig.addNunjucksGlobal('getNunjucksCode', function (componentName) {
let nunjucksCode = matter(fs.readFileSync(`examples/${componentName}.njk`, 'utf-8')).content

// Remove the `{% from "..." import ... %}` lines as those aren’t needed by users.
nunjucksCode = nunjucksCode.replace(/\{\%\sfrom\s[^\n]+\n\n/, '')

return nunjucksCode;
return nunjucksCode
})

// Passthrough
Expand All @@ -70,4 +70,4 @@ module.exports = function(eleventyConfig) {
? '/govuk-prototype-components'
: '/'
}
};
}

0 comments on commit 3f167d3

Please sign in to comment.