on master help sign in
fix typos, wrap comments
2fc8ca7Morgan Sutherland
scripts/build+9−5
@@ -1,6 +1,10 @@
1#!/usr/bin/env bash
1#!/usr/bin/env bash
2
2
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.
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
7+# single build.
4
8
5# Strip trailing slashes on input parameters
9# Strip trailing slashes on input parameters
6
10
@@ -36,7 +40,7 @@ read -n1 -s -r -p $'Boot your fake ~zod and run |mount %, then press any key to
36dist="dist-$(date -u '+%Y.%-m.%-d...%H.%M.%S')"
40dist="dist-$(date -u '+%Y.%-m.%-d...%H.%M.%S')"
37mkdir $dist
41mkdir $dist
38
42
39−# Render Posts
43+# Second render with |static in urbit (posts)
40
44
41copy_static_site $site $ship
45copy_static_site $site $ship
42rm -rf $ship/home/web/docs
46rm -rf $ship/home/web/docs
@@ -47,13 +51,13 @@ read -n1 -s -r -p $'Wait for sync, then run |static in your urbit, wait for it t
47echo -e "Copying posts from $site to $ship"
51echo -e "Copying posts from $site to $ship"
48cp -r $ship/.urb/put/web/* $dist
52cp -r $ship/.urb/put/web/* $dist
49
53
50−# Render docs
54+# First render with |static in urbit (docs)
51
55
52copy_static_site $site $ship
56copy_static_site $site $ship
53rm -rf $ship/home/web/posts
57rm -rf $ship/home/web/posts
54read -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'
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'
55
59
56−# Copy results of second render (docs) to distj folder
60+# Copy results of second render (docs) to dist folder
57
61
58cp -rn $ship/.urb/put/web/* $dist # cp -n prevents overwriting exist folders
62cp -rn $ship/.urb/put/web/* $dist # cp -n prevents overwriting exist folders
59
63
@@ -63,7 +67,7 @@ rm -rf $dist/posts/update
63rm -rf $dist/index
67rm -rf $dist/index
64rm -rf $dist/js/*
68rm -rf $dist/js/*
65
69
66−# Copy JavaScript
70+# Copy js directory
67
71
68cp -r $site/static-site/js $dist
72cp -r $site/static-site/js $dist
69
73