Add option to disable virtual template registration for layouts
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start at the plugin code that calls addTemplate() for base.njk, docs.njk, blog.njk, and api.njk, then trace how plugin configuration is read. Decide whether the option is global or per-layout, and verify that disabled layouts no longer register while enabled layouts still do.
Written by the indexing model from the issue text.
Description
Problem
The plugin always registers virtual templates for layouts (base.njk, docs.njk, blog.njk, api.njk) via addTemplate(). When a site has its own custom layouts in _includes/layouts/, the virtual templates take precedence and cannot be overridden.
Per Eleventy's virtual templates design, when a virtual template collides with a physical file, the virtual template wins silently for includes/layouts.
Impact
Sites that want to use the plugin's useful features (filters, collections, shortcodes, markdown config, bundled plugins) but have their own custom layouts cannot override the plugin's layouts.
The dart_node site has a superior base.njk with:
- Google Analytics
- Mermaid diagram support
- SVG icons instead of text characters
- Additional JSON-LD schemas (SoftwareSourceCode)
- Different CSS class names (
.headervs.site-header) - Site-specific JS loaded differently
Suggestion
Add a config option to skip layout registration:
techdocPlugin({
features: {
layouts: false, // Don't register virtual layout templates
}
})
Or more granularly:
techdocPlugin({
layouts: {
base: false, // Don't register base.njk
docs: false, // Don't register docs.njk
blog: true, // Still register blog.njk
api: true, // Still register api.njk
}
})
This would allow sites to use the plugin for its non-layout features while maintaining their own custom layouts.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
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.
More from Nimblesite/eleventy-plugin-techdoc
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
All issues in Nimblesite/eleventy-plugin-techdoc
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100