From bfdb2eb0ed2fc3b964600e7314e8be474a8a03d7 Mon Sep 17 00:00:00 2001 From: Per Andersson Date: Thu, 21 Mar 2024 02:04:38 +0100 Subject: [PATCH] Generate erlyaws.github.io This adds a script that creates a static mirror of the Yaws web page for publication as github pages on erlyaws.github.io. The script has work in progress for an automatic update of the static Yaws web page. Add erlyaws.github.io README.md section Fixes #486 --- README.md | 7 ++++++ scripts/update-gh-pages | 48 +++++++++++++++++++++++++++++++++++++++++ www/TAB.inc | 2 +- www/index.yaws | 12 ++++++----- 4 files changed, 63 insertions(+), 6 deletions(-) create mode 100755 scripts/update-gh-pages diff --git a/README.md b/README.md index 94afb7d58..200fe2282 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ This is Yaws, a webserver for dynamic content written in Erlang. ![Build Status](https://github.com/erlyaws/yaws/actions/workflows/main.yml/badge.svg) +Yaws Web Page +------------- + +The +[Yaws Web Page](https://erlyaws.github.io/) is available online with +documentation and examples. + Yaws Mailing List ----------------- diff --git a/scripts/update-gh-pages b/scripts/update-gh-pages new file mode 100755 index 000000000..877e1905c --- /dev/null +++ b/scripts/update-gh-pages @@ -0,0 +1,48 @@ +#!/bin/sh + +set -e + +[ -f LICENSE ] || { echo "Not in source tree root"; exit 1; } + +YAWS_ROOT="$PWD" +BUILD_ROOT="$YAWS_ROOT/build" +mkdir -p "$BUILD_ROOT" +BUILD_DIR="$(mktemp -d "$BUILD_ROOT/gh-pages.XXXX")" +INST_DIR="$BUILD_DIR/_inst" +REPO=erlyaws.github.io +YAWS_ID=update-gh-pages-yaws-server-$(date +%s) + +# FIXME cleanup when automating this +# cleanup upon exit +trap "pkill -f $YAWS_ID; rm -rf \"$BUILD_ROOT\"" 0 1 2 3 15 + +# build and install yaws +cd "$YAWS_ROOT" +mkdir -p "$INST_DIR" +autoreconf -fiv +./configure --prefix="$INST_DIR" +make all install + +# start yaws +# FIXME --id doesn't seem to work +"$INST_DIR"/bin/yaws --daemon #--id $YAWS_ID +"$INST_DIR"/bin/yaws --wait-started #--id $YAWS_ID + +# clone erlyaws.github.io gh-pages repo +cd "$BUILD_DIR" +git clone git@github.com:erlyaws/$REPO + +# mirror the site +wget --mirror \ + --max-redirect 0 \ + --directory-prefix $REPO \ + --no-host-directories \ + localhost:8000 + +# FIXME stop yaws + +# push updates +cd $REPO +git add . +git commit -av -m "Update gh-pages" +git push origin main diff --git a/www/TAB.inc b/www/TAB.inc index 6df443c1b..c2814f9f2 100644 --- a/www/TAB.inc +++ b/www/TAB.inc @@ -28,7 +28,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Top Page
Build Config and Run
Dynamic Content
-
Download
+
Download
Contact
Documentation
Articles
diff --git a/www/index.yaws b/www/index.yaws index 921ba452b..e1a5ca373 100644 --- a/www/index.yaws +++ b/www/index.yaws @@ -30,13 +30,13 @@ out(A) -> "well. Web applications don't have to be written in ugly ad hoc " "languages."}, - {h2,[], "yaws.hyber.org"}, + {h2,[], "erlyaws.github.io"}, {p,[], ["The www page for Yaws is ", - {a ,[{href,"http://yaws.hyber.org"}], "yaws.hyber.org"}, + {a ,[{href,"http://erlyaws.github.io"}], "erlyaws.github.io"}, ". The documentation, examples as well as releases can be " "found there, and of course, ", - {a ,[{href,"http://yaws.hyber.org"}],"yaws.hyber.org"}, + {a ,[{href,"http://erlyaws.github.io"}],"erlyaws.github.io"}, " is itself powered by Yaws."]}, @@ -45,8 +45,10 @@ out(A) -> "http://github.com/erlyaws/yaws"}]}, {p, [], ["Travis test results at :", - {a, [{href, "https://travis-ci.org/klacke/yaws"}], - "https://travis-ci.org/klacke/yaws"}]}, + {a, [{href, "https://github.com/erlyaws/yaws/actions" + "/workflows/main.yml"}], + "https://github.com/erlyaws/yaws/actions" + "/workflows/main.yml"}]}, {p,[], ["A mailing list exists at: ", {a,[{href,"https://lists.sourceforge.net/lists/listinfo/"