Skip to content

Commit 1ac89fa

Browse files
committed
Fix edit_uri
1 parent b4ca5cb commit 1ac89fa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

config/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ site_url: ""
33
use_directory_urls: false
44
docs_dir: !ENV SRC
55
repo_url: !ENV [REPO_URL, null]
6-
edit_uri: !ENV [EDIT_URI, null]
6+
edit_uri: !ENV [EDIT_URI, ""]
77
theme:
88
name: material
99
custom_dir: !ENV SRC_THEME

script/makedocs.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ if [ ! -z "${GITHUB_SERVER_URL}" -a ! -z "${GITHUB_REPOSITORY}" ] ; then
1111
export GIT=1
1212
export REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
1313
EDIT_URI="${SRC#/}"
14-
export EDIT_URI="${EDIT_URI:-/}"
14+
case "${GITHUB_REF}" in
15+
refs/heads/* )
16+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
17+
esac
18+
if [ ! -z "${BRANCH_NAME}" ] ; then
19+
export EDIT_URI="edit/${BRANCH_NAME}/${EDIT_URI}"
20+
fi
1521
fi
1622
export SRC=${WORKSPACE%/}/${SRC#/}
1723
# PlantUML !include root folder

0 commit comments

Comments
 (0)