Last updated 5 years ago
Was this helpful?
在撰写时,想在footer上添加一些内容,例如 "讨论和捐赠" ,则需要定制 footer.html 。
这个功能在 是通过 extrafooter 块实现的,在 conf.py 中有一个 templates_path (通常是 /_templates ),只要将扩展的页面放到该目录下并指定扩展哪个块就可以。
extrafooter
conf.py
templates_path
/_templates
例如,在 /_templates 目录下添加一个 footer.html 文件,内容如下:
footer.html
然后生成的的sphinx的每个页面底部都会增加一个 foo 链接。
{% extends '!footer.html' %} {% block extrafooter %} <!-- your html code here --> <p><a href="http://foo">new example link</a></p> {{ super() }} {% endblock %}