Nunjucks own environment watching
Nobody has claimed this yet.
- Dominant language
- Nunjucks
- Stars
- 547
- Forks
- 726
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 3
Description
While I realise that the example given in the docs for passing in your own instance of a Nunjucks Environment is purely illustrational, I spotted it as the solution for trimming down my {% include long/path/goes/here.html %} paths.
What I didn't realise (until I delved into the very sensibly linked docs) is that any changes to files in this path are not reflected when Eleventy spots a change unless the optional watch property is set to true.
Might I suggest a small change?
let env = process.env.ELEVENTY_ENV;
let nunjucksEnvironment = new Nunjucks.Environment(
new Nunjucks.FileSystemLoader("_includes", {
watch: env == "development"
})
);
Happy to submit a pull request if this might be a good idea.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Find the documentation example showing a custom Nunjucks Environment and its FileSystemLoader for Eleventy includes. Review the linked Nunjucks loader documentation first, then update the example to enable watching in development; done means the example reflects the suggested watch behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100