Closed mwawrusch closed 2 years ago
Create a directory docgen-templates
and configure the plugin with docgen: { templates: 'docgen-templates' }
in the Hardhat config.
Create a file in this directory called page.hbs
with the following contents:
# {{id}}
{{#each items}}
{{#hsection}}
{{>item}}
{{/hsection}}
{{/each}}
(Note: This is just the default with a different title.)
{{id}}
will render the filename of the page. I don't know if this is what you're asking for. Notably, it will include the .md
extension, so you may want to remove that using a helper. You can do that by adding helpers.js
in docgen-templates
:
module.exports['without-ext'] = function (str) {
return str.replace('.md', '');
}
Then using {{without-ext id}}
as the title.
Closing as resolved, let me know if you run into any issues.
awesome, thank you
We use docusaurus and that takes by default the title of the markdown as the sidebar header for that item.