5

Just hope to change the footer copyright info, generated by DocFX.

footer

Here is what I have done:

  1. Export template:

Run docfx template export default, get a folder _exported_templates\default

  1. Change the footer partials:

The files I have changed are .\partials_footer.liquid and .\partials\footer.tmpl.partial

  1. Use the updated template:

Run docfx -t _exported_templates\default.

  1. Serve the site again

Run docfx docfx.json --serve.

But the update is not shown when I refresh the documentation page. Is there anything else I have missed?

Blaise
  • 21,314
  • 28
  • 108
  • 169

2 Answers2

11

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

Yuby
  • 808
  • 7
  • 19
2

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;
}
RoelF
  • 7,483
  • 5
  • 44
  • 67