> For the complete documentation index, see [llms.txt](https://huataihuang.gitbook.io/cloud-atlas-draft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huataihuang.gitbook.io/cloud-atlas-draft/develop/doc/sphinx/add_extra_content_to_footer.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
