Skip to content

Commit 08ba127

Browse files
committed
支持多版本构建
1 parent ab44c8b commit 08ba127

5 files changed

Lines changed: 44 additions & 2 deletions

File tree

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
.idea/*
1+
.idea/
2+
*.pyc
3+
Pipfile
4+
test*
5+
build

baidu_verify_code-RTymycLNbm.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
50d1eeccda5a29142f1203ab740b1df0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ sphinxcontrib-jsmath==1.0.1
3939
sphinxcontrib-qthelp==1.0.2
4040
sphinxcontrib-serializinghtml==1.1.3
4141
sphinx-sitemap==2.2.0
42+
sphinx-multiversion==0.2.4

source/_templates/versions.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{%- if current_version %}
2+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
3+
<span class="rst-current-version" data-toggle="rst-current-version">
4+
<span class="fa fa-book"> Other Versions</span>
5+
v: {{ current_version.name }}
6+
<span class="fa fa-caret-down"></span>
7+
</span>
8+
<div class="rst-other-versions">
9+
{%- if versions.tags %}
10+
<dl>
11+
<dt>Tags</dt>
12+
{%- for item in versions.tags %}
13+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
14+
{%- endfor %}
15+
</dl>
16+
{%- endif %}
17+
{%- if versions.branches %}
18+
<dl>
19+
<dt>Branches</dt>
20+
{%- for item in versions.branches %}
21+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
22+
{%- endfor %}
23+
</dl>
24+
{%- endif %}
25+
</div>
26+
</div>
27+
{%- endif %}

source/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Add any Sphinx extension module names here, as strings. They can be
2929
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3030
# ones.
31-
extensions = ['chinese_search','sphinx.ext.mathjax']
31+
extensions = ['chinese_search','sphinx.ext.mathjax','sphinx_sitemap', 'sphinx_multiversion']
3232

3333
# Add any paths that contain templates here, relative to this directory.
3434
templates_path = ['_templates']
@@ -151,3 +151,12 @@
151151
disqus_shortname = 'iswbm' # Add this line to conf.py.
152152
html_baseurl = 'http://python.iswbm.com'
153153
html_extra_path = ["robots.txt"]
154+
155+
html_sidebars = {
156+
'**': [
157+
'versioning.html',
158+
],
159+
}
160+
161+
smv_latest_version = 'master'
162+
sitemap_url_scheme = "{link}"

0 commit comments

Comments
 (0)