File tree Expand file tree Collapse file tree 7 files changed +54
-17
lines changed Expand file tree Collapse file tree 7 files changed +54
-17
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,15 @@ if [ -z "$npm_version" ]; then
7
7
echo " npm is not installed"
8
8
exit 1
9
9
fi
10
+
10
11
gulp_version=$( gulp --version 2> /dev/null)
11
12
if [ -z " $gulp_version " ]; then
12
13
echo " gulp is not installed"
13
14
exit 1
14
15
fi
15
16
16
- npm install
17
+ if [ ! -d " node_modules" ] || [ " $( find package.json -prune -printf ' %T@\n' | cut -d . -f 1) " -gt " $( find node_modules -prune -printf ' %T@\n' | cut -d . -f 1) " ]; then
18
+ npm install
19
+ fi
20
+
17
21
gulp bundle
Original file line number Diff line number Diff line change 1
1
<footer class =" footer" >
2
2
<p >This page was built using the Antora default UI.</p >
3
3
<p >The source code for this UI is licensed under the terms of the MPL-2.0 license.</p >
4
+ <p ><a href =" https://github.com/cppalliance/site-docs" >https://github.com/cppalliance/site-docs</a ></p >
5
+ {{ #if page.attributes.boost-branch }}
6
+ <p >boost-branch: {{ page.attributes.boost-branch }} </p >
7
+ {{ /if }}
8
+ {{ #if page.attributes.commit-id }}
9
+ <p >commit-id: {{ page.attributes.commit-id }} </p >
10
+ {{ /if }}
4
11
</footer >
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- ./sitedoc.sh develop
3
+ if command -v git > /dev/null && git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
4
+ branch=$( git rev-parse --abbrev-ref HEAD)
5
+ else
6
+ branch=" develop"
7
+ fi
8
+
9
+ if [ " $branch " != " master" ] && [ " $branch " != " develop" ]; then
10
+ branch=" develop"
11
+ fi
12
+
13
+ ./sitedoc.sh " $branch "
Original file line number Diff line number Diff line change @@ -55,18 +55,27 @@ if ! [ -e "$script_dir/antora-ui/build/ui-bundle.zip" ]; then
55
55
cd " $cwd " || exit
56
56
fi
57
57
58
+ if command -v git > /dev/null && git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
59
+ commit_id=$( git rev-parse HEAD)
60
+ commit_id=$( expr substr " $commit_id " $( expr length " $commit_id " - 7) 8)
61
+ else
62
+ commit_id=" "
63
+ fi
64
+
58
65
# Run antora command
59
66
while test $# -gt 0; do
60
67
if [ " $1 " = " develop" ] || [ " $1 " = " master" ]; then
61
68
$ANTORA_CMD --fetch \
62
69
--attribute page-boost-branch=$1 \
63
70
--attribute page-boost-ui-branch=$1 \
71
+ --attribute page-commit-id=" $commit_id " \
64
72
libs.playbook.yml
65
73
66
74
elif [ " $1 " = " release" ]; then
67
75
$ANTORA_CMD --fetch \
68
76
--attribute page-boost-branch=master \
69
77
--attribute page-boost-ui-branch=master \
78
+ --attribute page-commit-id=" $commit_id " \
70
79
--attribute page-boost-is-release=true \
71
80
libs.playbook.yml
72
81
@@ -77,6 +86,7 @@ while test $# -gt 0; do
77
86
$ANTORA_CMD --fetch \
78
87
--attribute page-boost-branch=$1 \
79
88
--attribute page-boost-ui-branch=master \
89
+ --attribute page-commit-id=" $commit_id " \
80
90
" $f "
81
91
else
82
92
echo " Playbook \" $f \" does not exist"
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ asciidoc:
30
30
page-boost-branch : develop
31
31
page-boost-ui-branch : develop
32
32
page-boost-is-release : ' '
33
+ page-commit-id : ' '
33
34
34
35
site :
35
36
url : https://antora.cppalliance.org/${page-boost-branch}/lib/doc
Original file line number Diff line number Diff line change 20
20
asciidoc :
21
21
attributes :
22
22
page-boost-branch : develop
23
+ page-commit-id : ' '
23
24
24
25
site :
25
26
url : https://antora.cppalliance.org
Original file line number Diff line number Diff line change 42
42
43
43
cwd=$( pwd)
44
44
script_dir=$( dirname " $( readlink -f " $0 " ) " )
45
- if ! [ -e " $script_dir /antora-ui/build/ui-bundle.zip" ]; then
45
+ if ! [ -e " $script_dir /antora-ui/build/ui-bundle.zip" ] || \
46
+ find " $script_dir /antora-ui" -newer " $script_dir /antora-ui/build/ui-bundle.zip" -print -quit | grep -q .
47
+ then
46
48
cd " $script_dir /antora-ui" || exit
47
49
./build.sh
48
50
cd " $cwd " || exit
49
51
fi
50
52
51
- while test $# -gt 0; do
52
- if [ " $1 " = " develop" ]; then
53
- $ANTORA_CMD --fetch \
54
- --attribute page-boost-branch=$1 \
55
- site.playbook.yml
56
- elif [ " $1 " = " master" ]; then
57
- $ANTORA_CMD --fetch \
58
- --attribute page-boost-branch=$1 \
59
- site.playbook.yml
60
- else
61
- echo " invalid argument: '$1 '"
62
- fi
63
- shift
64
- done
53
+ if command -v git > /dev/null && git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
54
+ commit_id=$( git rev-parse HEAD)
55
+ commit_id=$( expr substr " $commit_id " $( expr length " $commit_id " - 7) 8)
56
+ else
57
+ commit_id=" "
58
+ fi
59
+
60
+ if [ " $1 " != " develop" ] && [ " $1 " != " master" ]; then
61
+ echo " invalid argument: '$1 '"
62
+ exit 1
63
+ fi
64
+
65
+ $ANTORA_CMD --fetch \
66
+ --attribute page-boost-branch=" $1 " \
67
+ --attribute page-commit-id=" $commit_id " \
68
+ site.playbook.yml
You can’t perform that action at this time.
0 commit comments