如果我有一些文档,例如Galleria's documentation,我该如何设置它以便在运行make html
命令时它会在每个页面上添加一个自定义页脚?
如果我将其输出为pdf格式,我发现我可能会使用conf.py的the latex preamble部分。
谢谢!
答案 0 :(得分:27)
您必须通过提供如下的html文件来扩展默认布局:
{% extends '!layout.html' %}
{% block footer %}
<!-- your html code here -->
{% endblock %}
将其保存在_templates/
layout.html
子目录中,并确保告诉conf.py
在哪里找到此目录:
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
有关模板的更多信息,请访问:http://sphinx.pocoo.org/templating.html