8000 made the build script replace the "_static" links with "static" (no u… · Sengorius/sengorius.github.io@47bf200 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47bf200

Browse files
author
Patrick Blawert
committed
made the build script replace the "_static" links with "static" (no underscore)
1 parent 3c69b72 commit 47bf200

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

builder

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ fi
1717
SPHINX_IMAGE=sengorius/sphinx:3
1818
DOCKER_START="docker run --rm -u $(id -u):$(id -g) -v $CURRENT_DIR/docs:/var/documentation -it $SPHINX_IMAGE"
1919

20+
function fix_static_links() {
21+
if [[ -d "$CURRENT_DIR/docs/build/html" ]]; then
22+
mv ${CURRENT_DIR}/docs/build/html/_static ${CURRENT_DIR}/docs/build/html/static
23+
find ${CURRENT_DIR}/docs/build/html -type f -exec sed -i 's/_static/static/g' {} \;
24+
echo "Renamed directory _static to static and fixed links within all files."
25+
fi
26+
}
27+
2028
# and run it with the given command
2129
if [[ "init" == "$COMMAND" ]]; then
2230
${DOCKER_START} sphinx-quickstart
2331
elif [[ "make" == "$COMMAND" ]]; then
2432
${DOCKER_START} make html
33+
fix_static_links
2534
elif [[ "release" == "$COMMAND" ]]; then
2635
${DOCKER_START} make html
36+
fix_static_links
2737

2838
if [[ -d "$CURRENT_DIR/docs/build/html" ]]; then
2939
if [[ -d "$CURRENT_DIR/docs/docs" ]]; then

source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@
5050
# relative to this directory. They are copied after the builtin static files,
5151
# so a file named "default.css" will overwrite the builtin "default.css".
5252
html_static_path = ['_static']
53-
html_css_files = ['additional.css']
53+
html_css_files = ['additional.css']
54+
html_copy_source = False
55+
html_show_sourcelink = False

0 commit comments

Comments
 (0)
0