File tree Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,20 @@ SPHINXBUILD ?= sphinx-build
8
8
SOURCEDIR = .
9
9
BUILDDIR = _build
10
10
11
+ LANGUAGE = zh_CN
12
+
13
+ SPHINXOPTS += -D language=$(LANGUAGE )
14
+
15
+ export CURRENT_GIT_COMMIT_HASH := $(shell git rev-parse --short HEAD)
16
+
17
+ GIT_STATUS := $(shell git status --porcelain --untracked-files=no)
18
+
19
+ ifeq ($(strip $(GIT_STATUS ) ) ,)
20
+ export CURRENT_GIT_COMMIT_DIRTY = 0
21
+ else
22
+ export CURRENT_GIT_COMMIT_DIRTY = 1
23
+ endif
24
+
11
25
# Put it first so that "make" without argument is like "make help".
12
26
help :
13
27
@$(SPHINXBUILD ) -M help " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
21
35
22
36
.PHONY :
23
37
html-multiversion :
24
- rm -rf ./$(BUILDDIR ) && sphinx-multiversion " $( SOURCEDIR) " ./$(BUILDDIR ) /html && cp -rf ./$(BUILDDIR ) /html/master/* ./$(BUILDDIR ) /html/
38
+ rm -rf ./$(BUILDDIR ) && CURRENT_GIT_COMMIT_DIRTY=0 sphinx-multiversion $( SPHINXOPTS ) " $( SOURCEDIR) " ./$(BUILDDIR ) /html && cp -rf ./$(BUILDDIR ) /html/master/* ./$(BUILDDIR ) /html/
Original file line number Diff line number Diff line change
1
+ {% extends "!footer.html" %}
2
+
3
+ {% block extrafooter %}
4
+ < div >
5
+ < br >
6
+ 官网 < a href ="https://dragonos.org "> https://dragonos.org</ a > | 论坛 < a href ="https://bbs.dragonos.org.cn "> https://bbs.dragonos.org.cn</ a > | < a href ="https://dragonos.org "> 赞助DragonOS,成就未来!</ a >
7
+ </ div >
8
+ {% endblock %}
Original file line number Diff line number Diff line change 19
19
project = 'DragonOS'
20
20
copyright = '2022-2024, DragonOS Community'
21
21
author = 'longjin'
22
+ github_org = 'DragonOS-Community'
23
+ github_repo = 'DragonOS'
22
24
23
25
# The full version, including alpha/beta/rc tags
24
26
release = 'dev'
97
99
98
100
if os .environ .get ("SPHINX_MULTIVERSION_GIT_COMMIT" , "" ) != "" :
99
101
html_context ["commit" ] = os .environ ["SPHINX_MULTIVERSION_GIT_COMMIT" ]
100
-
102
+ elif os .environ .get ("CURRENT_GIT_COMMIT_HASH" , "" ) != "" :
103
+ html_context ["commit" ] = os .environ ["CURRENT_GIT_COMMIT_HASH" ]
101
104
102
105
103
106
# 截取前 7 位 commit hash,如果长度不足则不截取
104
107
if "commit" in html_context :
105
108
html_context ["commit" ] = html_context ["commit" ][:7 ]
109
+ if os .environ .get ("CURRENT_GIT_COMMIT_DIRTY" , "" ) == "1" :
110
+ html_context ["commit" ] += "-dirty"
111
+
112
+
113
+ # -- Set GitHub URL for Edit on GitHub links ---
114
+ html_context ['display_github' ] = True
115
+ html_context ['github_user' ] = github_org
116
+ html_context ['github_repo' ] = github_repo
117
+ html_context ['github_version' ] = html_context ['commit' ] if 'commit' in html_context else 'master'
118
+ html_context ['conf_py_path' ] = '/docs/'
You can’t perform that action at this time.
0 commit comments