From 6b38e3a0bdaba024c71b071b226d824344c55005 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 29 Sep 2022 13:33:41 -0500 Subject: Add preview command --- vienna | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/vienna b/vienna index 8ce8468..31c46c7 100755 --- a/vienna +++ b/vienna @@ -26,6 +26,9 @@ PARAMETERS: publish publish the site after building. NOTE: this requires a .vienna.sh file in the site root. you'll have to define a \`publish' function there. + preview preview the site locally after building. + NOTE: this requires a .vienna.sh file in the site root. + you'll have to define a \`preview' function there. you can redefine any variables or functions vienna uses in \$VIENNA_CONFIG, which by default is ./.vienna.sh. vienna uses heredoc-inspired templating, so @@ -111,10 +114,27 @@ cleanup() { } publish() { - echo >&2 "I want to publish your website but I don't know how." - echo >&2 "Make a $CONFIG file in this directory and write a" - echo >&2 "\`publish' function telling me what to do. I rec-" - echo >&2 "ommend using \`rsync', but you live your life." + cat <&2 + +I want to publish your website but I don't know how. +Make a $CONFIG file in this directory and write a \`publish' +function telling me what to do. I recommend using \`rsync', +but you live your life." + +EOF + exit 3 +} + +preview() { + cat <&2 + +I want to show you a preview of your website but I don't +know how. Make a $CONFIG file in this directory and write +a \`preview' function telling me what to do. I recommend +using something like \`python -m http.server', but you live +your life." + +EOF exit 3 } -- cgit 1.4.1-21-gabe81