Hi,

Here's a simple script to automate the generation of the static content for
http://mynewt.incubator.apache.org. It basically captures the steps Aditi
takes when updating the site.

Thanks,
-Todd


diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..f810ac8
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -e
+
+if [[ "$1" != "build"  ]]; then
+    echo "Build the mynewt website"
+    echo "Make sure git status is claen and run from the master branch"
+    echo
+    echo "Usage: $0 build"
+    exit
+fi
+
+echo mkdocs clean build:
+mkdocs build --clean
+
+echo Remove unwanted html templates
+find site -name "*.html" | xargs grep '{%.*%}' -l | xargs rm
+
+echo Copy extras into site
+cp -a extras/ site/
+
+echo Change git branch to asf-site
+git checkout asf-site
+
+echo Remove old content
+ls | grep -v site | xargs rm -rf
+
+echo Copy contents of site directory for serving
+cp -a site/ .
+
+echo ---
+echo --- You are now on the asf-site branch
+echo --- Review git diffs before commiting
+echo ---
+git status
+

Reply via email to