Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest using a subfolder #269

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ module.exports = function(eleventyConfig) {
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
// The folder where all your content will live:
input: 'app',
// Use layouts from the plugin
layouts: 'node_modules/@x-govuk/govuk-eleventy-plugin/layouts'
layouts: '../node_modules/@x-govuk/govuk-eleventy-plugin/layouts'
}
}
};
Expand All @@ -73,6 +75,12 @@ Once all the files have been generated, a preview URL will be shown which you ca

Whenever you add a new page, or edit an existing one, the browser will automatically refresh with any of your changes applied.

## Create a folder

You can now create a folder to contain all the content for your site. This is often called `app`. If your site is documentation for another service, then it could be named `docs`.

Whichever folder name you choose should be referenced under the `input` key within the `eleventy.config.js` file.

## Create your first page

You’re now ready to start adding pages to your site.
Expand All @@ -90,7 +98,7 @@ title: My first page
This is my first page, built using Eleventy and `@x-govuk/govuk-eleventy-plugin`.
```

Create a file named `index.md` file to the root directory of your project, and add the above content.
Create a file named `index.md` file within the folder you created, and add the above content.

The first page in your site should also have a `homepage` value set to `true`[^1]. This is used to work out the structure of your site if it has [nested pages](https://www.11ty.dev/docs/plugins/navigation/).

Expand Down