File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,15 @@ if [ -z "$npm_version" ]; then
77 echo " npm is not installed"
88 exit 1
99fi
10+
1011gulp_version=$( gulp --version 2> /dev/null)
1112if [ -z " $gulp_version " ]; then
1213 echo " gulp is not installed"
1314 exit 1
1415fi
1516
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+
1721gulp bundle
Original file line number Diff line number Diff line change 11<footer class =" footer" >
22 <p >This page was built using the Antora default UI.</p >
33 <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 }}
411</footer >
Original file line number Diff line number Diff line change 11#! /bin/sh
22
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
5555 cd " $cwd " || exit
5656fi
5757
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+
5865# Run antora command
5966while test $# -gt 0; do
6067 if [ " $1 " = " develop" ] || [ " $1 " = " master" ]; then
6168 $ANTORA_CMD --fetch \
6269 --attribute page-boost-branch=$1 \
6370 --attribute page-boost-ui-branch=$1 \
71+ --attribute page-commit-id=" $commit_id " \
6472 libs.playbook.yml
6573
6674 elif [ " $1 " = " release" ]; then
6775 $ANTORA_CMD --fetch \
6876 --attribute page-boost-branch=master \
6977 --attribute page-boost-ui-branch=master \
78+ --attribute page-commit-id=" $commit_id " \
7079 --attribute page-boost-is-release=true \
7180 libs.playbook.yml
7281
@@ -77,6 +86,7 @@ while test $# -gt 0; do
7786 $ANTORA_CMD --fetch \
7887 --attribute page-boost-branch=$1 \
7988 --attribute page-boost-ui-branch=master \
89+ --attribute page-commit-id=" $commit_id " \
8090 " $f "
8191 else
8292 echo " Playbook \" $f \" does not exist"
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ asciidoc:
3030 page-boost-branch : develop
3131 page-boost-ui-branch : develop
3232 page-boost-is-release : ' '
33+ page-commit-id : ' '
3334
3435site :
3536 url : https://antora.cppalliance.org/${page-boost-branch}/lib/doc
Original file line number Diff line number Diff line change 2020asciidoc :
2121 attributes :
2222 page-boost-branch : develop
23+ page-commit-id : ' '
2324
2425site :
2526 url : https://antora.cppalliance.org
Original file line number Diff line number Diff line change 4242
4343cwd=$( pwd)
4444script_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
4648 cd " $script_dir /antora-ui" || exit
4749 ./build.sh
4850 cd " $cwd " || exit
4951fi
5052
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