@@ -0,0 +1,70 @@
3+# Use this script to automate building the website. You'll need a fresh copy of the repository and a fresh fakezod booted with the static-site-dev branch of Arvo. The site is built in two steps because Urbit typically runs out of memory before finishing a full build. One fakezod is usually good for only a single build.
5+# Strip trailing slashes on input parameters
10+# Copy static_site to ship
14+ echo -e "Copying source files from $site to $ship"
15+ rm -rf $ship/home/web
16+ cp -r $site/static-site $ship/home/web
17+ cp $site/static-site/index.hoon $ship/home/web.hoon
18+ rm -rf $ship/home/ren/partials
19+ cp -r $site/partials $ship/home/ren/partials
20+ cp $site/urb.hoon $ship/home/ren
23+# Print instructions if both parameters aren't provided
25+if [[ $# -lt 2 ]] ; then
26+ printf 'This command needs two arguments:\n(1) the path to your urbit.org repository\n(2) the path to your pier\n'
32+read -n1 -s -r -p $'Boot your fake ~zod and run |mount %, then press any key to continue\n'
36+dist="dist-$(date -u '+%Y.%-m.%-d...%H.%M.%S')"
41+copy_static_site $site $ship
42+rm -rf $ship/home/web/docs
43+read -n1 -s -r -p $'Wait for sync, then run |static in your urbit, wait for it to finish, then press any key to continue\n'
45+# Copy results of first render (posts) to dist folder
47+echo -e "Copying posts from $site to $ship"
48+cp -r $ship/.urb/put/web/* $dist
52+copy_static_site $site $ship
53+rm -rf $ship/home/web/posts
54+read -n1 -s -r -p $'Wait for sync, then run |static in your urbit again, wait for it to finish, then press any key to continue\n'
56+# Copy results of second render (docs) to distj folder
58+cp -rn $ship/.urb/put/web/* $dist # cp -n prevents overwriting exist folders
60+# Remove unecessary files
62+rm -rf $dist/posts/update
68+cp -r $site/static-site/js $dist
70+echo -e "Find your website in $dist"