about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-09-29 13:33:41 -0500
committerCase Duckworth2022-09-29 13:33:41 -0500
commit6b38e3a0bdaba024c71b071b226d824344c55005 (patch)
tree6c5bbb8912f496b9253f2941b52711c1c1d84173
parentshellcheck (diff)
downloadvienna-6b38e3a0bdaba024c71b071b226d824344c55005.tar.gz
vienna-6b38e3a0bdaba024c71b071b226d824344c55005.zip
Add preview command
-rwxr-xr-xvienna28
1 files changed, 24 insertions, 4 deletions
diff --git a/vienna b/vienna index 8ce8468..31c46c7 100755 --- a/vienna +++ b/vienna
@@ -26,6 +26,9 @@ PARAMETERS:
26 publish publish the site after building. 26 publish publish the site after building.
27 NOTE: this requires a .vienna.sh file in the site root. 27 NOTE: this requires a .vienna.sh file in the site root.
28 you'll have to define a \`publish' function there. 28 you'll have to define a \`publish' function there.
29 preview preview the site locally after building.
30 NOTE: this requires a .vienna.sh file in the site root.
31 you'll have to define a \`preview' function there.
29 32
30you can redefine any variables or functions vienna uses in \$VIENNA_CONFIG, 33you can redefine any variables or functions vienna uses in \$VIENNA_CONFIG,
31which by default is ./.vienna.sh. vienna uses heredoc-inspired templating, so 34which by default is ./.vienna.sh. vienna uses heredoc-inspired templating, so
@@ -111,10 +114,27 @@ cleanup() {
111} 114}
112 115
113publish() { 116publish() {
114 echo >&2 "I want to publish your website but I don't know how." 117 cat <<EOF >&2
115 echo >&2 "Make a $CONFIG file in this directory and write a" 118
116 echo >&2 "\`publish' function telling me what to do. I rec-" 119I want to publish your website but I don't know how.
117 echo >&2 "ommend using \`rsync', but you live your life." 120Make a $CONFIG file in this directory and write a \`publish'
121function telling me what to do. I recommend using \`rsync',
122but you live your life."
123
124EOF
125 exit 3
126}
127
128preview() {
129 cat <<EOF >&2
130
131I want to show you a preview of your website but I don't
132know how. Make a $CONFIG file in this directory and write
133a \`preview' function telling me what to do. I recommend
134using something like \`python -m http.server', but you live
135your life."
136
137EOF
118 exit 3 138 exit 3
119} 139}
120 140