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

28
scripts/recipe-footer.md Normal file
View File

@@ -0,0 +1,28 @@
### Tip your waiter (support me) 👏
Did you receive excellent service? Want to make your waiter happy? (_..and support development of current and future recipes!_) See the [support](/support/) page for (_free or paid)_ ways to say thank you! 👏
### Flirt with your waiter (subscribe to updates) :kissing_heart::love_letter:
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the [RSS feed](https://mastodon.social/@geekcookbook_changes.atom), or leave your email address below, and we'll keep you updated. (*double-opt-in, no monkey business, no spam either - check the [archive](https://us16.campaign-archive.com/home/?u=a1d9cee4402be76497a2baf49&id=10e284530a) for proof!*)
<!-- Begin Mailchimp Signup Form -->
<div id="mailchimp">
<form action="https://funkypenguin.us16.list-manage.com/subscribe/post?u=a1d9cee4402be76497a2baf49&amp;id=10e284530a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<div class="mc-field-group">
<input type="email" value="your-email-address-here 💋" name="EMAIL" class="required email" id="mce-EMAIL" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"> <span align="right"><input type="submit" value="Subscribe me, sexy!" name="subscribe" id="mc-embedded-subscribe" class="button"></span>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a1d9cee4402be76497a2baf49_10e284530a" tabindex="-1" value=""></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
### Your comments? 💬