1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-13 01:36:23 +00:00

Avoid commiting staging directory

This commit is contained in:
David Young
2019-05-16 10:00:47 +12:00
parent 4654c131b2
commit 2dd09c0cbc
11 changed files with 159 additions and 55 deletions

28
scripts/build.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# This script prepares mkdocs for a build (there are some adjustments to be made to the recipes before publishing)
# Copy the contents of "manuscript" to a new "publish" folder
mkdir -p publish
mkdir -p publish/overrides
cp -r manuscript publish/
cp mkdocs.yml publish/
# Append a common footer to all recipes
for i in `find publish/manuscript -name "*.md"`
do
# Does this recipe already have a "tip your waiter" section?
grep -q "Tip your waiter" $i
if [ $? -eq 1 ]
then
echo -e "\n" >> $i
cat scripts/recipe-footer.md >> $i
else
echo "WARNING - hard-coded footer exists in $i"
fi
done
# Now build the docs for publishing
mkdocs build -f publish/mkdocs.yml
# Setup any necessary netlify redirects
cp netlify_redirects.txt publish/site/_redirects