- Export template:
- Run
docfx template export default, then you'll see default template in_exported_templates\default
- Run
- Change themes in default template, e.g:
- Adding external resource: modify
styles\head.tmpl.partial - CSS change: modify
styles\docfx.cssorstyles\main.css
- Adding external resource: modify
- Use customized template:
- Run
docfx -t _exported_templates\default, which will use your customized template!
- Run
Answer from Yuby on Stack OverflowNOTE: It is possible that DocFX updates its embedded templates when releasing new version. So please make sure to re-export the template if you overwrite or dependent on that template in your custom template.
- Export template:
- Run
docfx template export default, then you'll see default template in_exported_templates\default
- Run
- Change themes in default template, e.g:
- Adding external resource: modify
styles\head.tmpl.partial - CSS change: modify
styles\docfx.cssorstyles\main.css
- Adding external resource: modify
- Use customized template:
- Run
docfx -t _exported_templates\default, which will use your customized template!
- Run
NOTE: It is possible that DocFX updates its embedded templates when releasing new version. So please make sure to re-export the template if you overwrite or dependent on that template in your custom template.
By setting "template" docfx.json, the last templates override the first ones if the file name inside the template matches. Therefore, it is enough to create a new folder for your template, copy the changed files into it, adhering to the folder structure of the original template. Include the custom template in the config file. The "default" template is required. Look at the example template default(zh-cn)