index : livejrnl-builder.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2023-09-24 14:35:30.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2023-09-24 14:35:30.0 +00:00:00
commit
7467a627372650131a1c1c9fc906e2cc68f15d04 [patch]
tree
400d56789cb615c347a9730bf33c834ff0d26129
parent
3bd854f51408810523fbb922b12441ea156b932b
download
7467a627372650131a1c1c9fc906e2cc68f15d04.tar.gz

feat: add build script and sample config



Diff

 build.sh    | 23 +++++++++++++++++++++++
 config.json | 10 ++++++++++
 2 files changed, 33 insertions(+)

diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..9fd2640
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,23 @@
#!/bin/env zsh

CURRENT_DIR=$(realpath $(dirname $0))
LIVEJRNL_TEMPLATE_DIR="$CURRENT_DIR/templates/"
LIVEJRNL_OUTPUT_DIR="$CURRENT_DIR/build/"

cd $CURRENT_DIR
cd livejrnl
# enter venv
source .venv/bin/activate

# build the site and RSS feeds
python src/livejrnl.py -t $LIVEJRNL_TEMPLATE_DIR/deadjournal/index.html.template -o $LIVEJRNL_OUTPUT_DIR/index.html --config="$CURRENT_DIR/config.json"
python src/livejrnl.py -t $LIVEJRNL_TEMPLATE_DIR/shared/rss_feed.xml.template -o $LIVEJRNL_OUTPUT_DIR/feed.xml --config="$CURRENT_DIR/config.json"
python src/livejrnl.py -t $LIVEJRNL_TEMPLATE_DIR/shared/rss_feed.xml.template -o $LIVEJRNL_OUTPUT_DIR/feed_latest.xml --cutoff=5 --config="$CURRENT_DIR/config.json"

# exit venv
deactivate

cd $CURRENT_DIR
# build CSS
mkdir -p ./build/css/
sassc -t compressed "$LIVEJRNL_TEMPLATE_DIR/deadjournal/scss/_stylesheet.scss" "$LIVEJRNL_OUTPUT_DIR/css/stylesheet.min.css"
\ No newline at end of file
diff --git a/config.json b/config.json
new file mode 100644
index 0000000..eb1398f
--- /dev/null
+++ b/config.json
@@ -0,0 +1,10 @@
{
	"title": "Welcome to my LiveJrnl",
	"base_url": "https://localhost",
	"description": "Write a bit about your website here.",
	"author": "Ashley Robin",
	"author_link": "https://localhost/arobin",
	"year": "2023",
	"language": "en",
	"rss_language": "en-gb"
}
\ No newline at end of file