-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nhsuk/eleventy
Render documentation with eleventy instead of gulp
- Loading branch information
Showing
7 changed files
with
1,632 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import nunjucks from 'nunjucks' | ||
import { EleventyHtmlBasePlugin } from '@11ty/eleventy' | ||
|
||
const nunjucksEnv = nunjucks.configure([ | ||
// Our own components which we will ship in the release | ||
'src/components', | ||
|
||
// Includes specific to our documentation | ||
'docs/_templates/', | ||
|
||
// NHS.UK frontend components | ||
'node_modules/nhsuk-frontend/packages/components' | ||
]) | ||
|
||
export default function (eleventyConfig) { | ||
// Configure a custom nunjucks environment | ||
eleventyConfig.setLibrary('njk', nunjucksEnv) | ||
|
||
// Copy static files | ||
eleventyConfig.addPassthroughCopy({ | ||
'node_modules/nhsuk-frontend/dist/nhsuk.css': 'assets/nhsuk.css', | ||
'dist/nhsapp.css': 'assets/nhsapp.css' | ||
}) | ||
|
||
// Watch for changes in these directories and files | ||
eleventyConfig.addWatchTarget('./docs/') | ||
eleventyConfig.addWatchTarget('./dist/nhsapp.css') | ||
|
||
// We need this HtmlBase plugin for serving our docs on github pages at a subdirectory | ||
// https://www.11ty.dev/docs/plugins/html-base/ | ||
eleventyConfig.addPlugin(EleventyHtmlBasePlugin) | ||
|
||
return { | ||
dir: { | ||
input: 'docs/views', | ||
output: 'dist/docs' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.