Skip to content

Commit

Permalink
更新 sphinx 配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims committed Jan 28, 2024
1 parent 100d0dc commit d965167
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
templates_path = ['_templates']
exclude_patterns = []

rst_prolog = open('_static/links.rst', 'r', encoding="utf8").read()
rst_prolog = '\n'.join(
list(
map(
lambda filename: open(f'_static/{filename}', 'r', encoding="utf8").read(),
['links.rst']))) + '\n'

language = 'zh_CN'

Expand All @@ -32,3 +36,19 @@

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_search_language = 'zh'
html_last_updated_fmt = '%Y-%m-%d %H:%M:%S %z'


def setup(app):
FORCE_RELOAD_JS = """
(function () {
if (window.localStorage) {
if (!localStorage.getItem("firstLoad")) {
localStorage["firstLoad"] = true;
window.location.reload();
} else localStorage.removeItem("firstLoad");
}
})();
"""
app.add_js_file(None, body=FORCE_RELOAD_JS)

0 comments on commit d965167

Please sign in to comment.