Just hope to change the footer copyright info, generated by DocFX.
Here is what I have done:
Run docfx template export default
, get a folder _exported_templates\default
The files I have changed are .\partials_footer.liquid and .\partials\footer.tmpl.partial
Run docfx -t _exported_templates\default
.
Run docfx docfx.json --serve
.
But the update is not shown when I refresh the documentation page. Is there anything else I have missed?
Try merge step 3, 4 into: docfx -t _exported_templates\default --serve
.
Explanation: If you open the build output in _site
after step 3, you should find the footer is actually updated. In step 4, DocFX builds the site again before serving, so finally you find the original footer because this build doesn't use your customized template.
Another quick solution is to add _appFooter
to global metadata in docfx.json
like:
"globalMetadata": {
"_appFooter": "<span>Customized Footer</span>"
},
Full reserved metadata list can be found here: http://dotnet.github.io/docfx/tutorial/docfx.exe_user_manual.html#322-reserved-metadata
The easiest way to do this is to change the model directly. In your template, create a file called conceptual.extension.js
and use the following code:
exports.postTransform = function (model) {
model._appFooter = "<span>Copyright © 2015-2017 MY COPYRIGHT<br>Generated by <strong>DocFX</strong></span>";
return model;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With