Allow themes to have a config in documentjs.json
- Dominant language
- JavaScript
- Stars
- 598
- Forks
- 371
- PR merge metrics
- No merged PRs in 30d
Description
To allow for better themeability, I'd like to consider adding the ability to pass config variables into the mustache templates from the `documentjs.json` file.
For example, let's say I want to create a theme with two options for the header nav. One black and one blue. I can set up my theme and CSS to support both, but then allow the user to define which one they want in the json file:
```
themeConfig: {
navColor: 'blue'
}
```
That value would automatically get passed into each mustache template so that I can use that variable anywhere like `layout.mustache`
```
...
```
This makes it possible for designers to create themes that other users (non-designers) can customize.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how documentjs.json theme settings reach the Mustache templates, especially layout.mustache. Define how the themeConfig.navColor example should be exposed to every template, and verify that a configured value can be used in the rendered navigation output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100