doc/proto: mirror the required directory structure

Might as well make this easier for us locally.
This commit is contained in:
Peter Hutterer 2023-03-09 13:41:48 +10:00
parent 3bcece1923
commit 2665224461
7 changed files with 5 additions and 11 deletions

View file

@ -62,12 +62,16 @@ fi
cp "$TEMPLATEDIR/config.toml" "$SITEDIR/"
pushd "$TEMPLATEDIR" > /dev/null || exit 1
find . -type f -name "*.md"
find . -type f -name "*.md" -exec install -D {} "$SITEDIR/content/{}" \;
popd > /dev/null || exit 1
pushd "$SITEDIR" > /dev/null || exit 1
# Generate a list of available interfaces and read that
# list line-by-line to generate a separate .md file
# for each interface
mkdir -p "$SITEDIR/content/interfaces"
while read -r iface; do
$SCANNER --component=ei --jinja-extra-data="{ \"interface\": \"$iface\" }" --output="$SITEDIR/content/interfaces/$iface.md" "$PROTOFILE" "$TEMPLATEDIR/interface.md.tmpl"
done < <($SCANNER --component=ei "$PROTOFILE" - <<EOF
@ -77,16 +81,6 @@ done < <($SCANNER --component=ei "$PROTOFILE" - <<EOF
EOF
)
mkdir -p "$SITEDIR/content/doc"
cp "$TEMPLATEDIR/_index.md" "$SITEDIR/content"
cp "$TEMPLATEDIR/overview.md" "$SITEDIR/content/doc"
cp "$TEMPLATEDIR/types.md" "$SITEDIR/content/doc"
cp "$TEMPLATEDIR/specification.md" "$SITEDIR/content/doc"
cp "$TEMPLATEDIR/initial-handshake.md" "$SITEDIR/content/doc"
cp "$TEMPLATEDIR/interface-index.md" "$SITEDIR/content/interfaces/_index.md"
cp "$TEMPLATEDIR/chapter-index.md" "$SITEDIR/content/doc/_index.md"
hugo
popd > /dev/null || exit 1