# sphinx文档的footer定制

在撰写[云图](https://cloud-atlas.readthedocs.io/zh_CN/latest/index.html)时，想在footer上添加一些内容，例如 "讨论和捐赠" ，则需要定制 footer.html 。

这个功能在[sphinx-doc](http://sphinx-doc.org/) 是通过 `extrafooter` 块实现的，在 `conf.py` 中有一个 `templates_path` （通常是 `/_templates` )，只要将扩展的页面放到该目录下并指定扩展哪个块就可以。

例如，在 `/_templates` 目录下添加一个 `footer.html` 文件，内容如下:

```markup
{% extends '!footer.html' %}

{% block extrafooter %}
    <!-- your html code here -->
    <p><a href="http://foo">new example link</a></p>
    {{ super() }}
{% endblock %}
```

然后生成的的sphinx的每个页面底部都会增加一个 foo 链接。

## 参考

* [Newbie question on adding extra content to footer](https://github.com/rtfd/sphinx_rtd_theme/issues/349)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/develop/doc/sphinx/add_extra_content_to_footer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
