Skip to content

Commit

Permalink
Allow for more than one index file in docs folders. (elastic#5220)
Browse files Browse the repository at this point in the history
  • Loading branch information
simitt authored and ruflin committed Sep 21, 2017
1 parent 35341b4 commit 4ed639a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions script/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ else
echo "$docs_dir already exists. Not cloning."
fi


index="${GOPATH%%:*}/src/${path}/index.asciidoc"

echo "Building docs for ${name}..."
echo "Index document: ${index}"

dest_dir="$html_dir/${name}"
mkdir -p "$dest_dir"
params="--chunk=1"
if [ "$PREVIEW" = "1" ]; then
params="--chunk=1 -open chunk=1 -open"
fi
$docs_dir/build_docs.pl $params --doc "$index" -out "$dest_dir"

index_list="$(find ${GOPATH%%:*}/src/$path -name 'index.asciidoc')"
for index in $index_list
do
echo "Building docs for ${name}..."
echo "Index document: ${index}"
index_path=$(basename $(dirname $index))
echo "Index path: $index_path"

dest_dir="$html_dir/${name}/${index_path}"
mkdir -p "$dest_dir"
params="--chunk=1"
if [ "$PREVIEW" = "1" ]; then
params="--chunk=1 -open chunk=1 -open"
fi
$docs_dir/build_docs.pl $params --doc "$index" -out "$dest_dir"
done

0 comments on commit 4ed639a

Please sign in to comment.