3# Use this script to automate building the website. You'll need a fresh copy of
4# the repository and a fresh fakezod booted with the static-site-dev branch of
5# Arvo. The site is built in two steps because Urbit typically runs out of
6# memory before finishing a full build. One fakezod is usually good for only a
9# Strip trailing slashes on input parameters
14# Copy static_site to ship
18 echo -e "- Copying source files from $site to $ship"
20 cp -r $site/static-site $ship/home/web
21 cp $site/static-site/index.hoon $ship/home/web.hoon
22 rm -rf $ship/home/ren/partials
23 cp -r $site/partials $ship/home/ren/partials
24 cp $site/urb.hoon $ship/home/ren
27# Print instructions if both parameters aren't provided
29if [[ $# -lt 2 ]] ; then
30 printf '- This command needs two arguments:\n(1) the path to your urbit.org repository\n(2) the path to your pier\n'
36read -n1 -s -r -p $'- Boot your fakezod and run |mount %, then press any key to continue\n'
40dist="dist-$(date -u '+%Y.%-m.%-d...%H.%M.%S')"
43# Second render with |static in urbit (posts)
45copy_static_site $site $ship
46rm -rf $ship/home/web/docs
47read -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'
49# Copy results of first render (posts) to dist folder
51echo -e "- Copying posts from $site to $ship"
52cp -r $ship/.urb/put/web/* $dist
54# First render with |static in urbit (docs)
56copy_static_site $site $ship
57rm -rf $ship/home/web/posts
58read -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'
60# Copy results of second render (docs) to dist folder
62rsync -av --ignore-existing $ship/.urb/put/web/* $dist
64# Remove unecessary files
71cp -r $site/static-site/js $dist
73echo -e "- Find your website in $dist"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list