From 7af78e72fffeba009c93c4d768e748f8521468f4 Mon Sep 17 00:00:00 2001 From: haturatu Date: Fri, 11 Oct 2024 01:41:40 +0900 Subject: wip --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ lumebuild.sh | 3 ++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29d93ed..0fcce45 100644 --- a/README.md +++ b/README.md @@ -1 +1,56 @@ # lumebuild + +A simple bash script to automate the build process for Lume static site generator. + +## Overview + +This script automates the following tasks: +1. Commits changes in the source directory +2. Converts images to WebP format (if configured) +3. Builds the site using Lume + +## Prerequisites + +- Deno installed +- Lume static site generator +- Git +- WebP conversion tool (optional) + +## Configuration + +Before using the script, update the following variables: +```bash +LUME_DIR="/your/lume/dir" # Path to your Lume project directory +WEBPSH="/your/webp/convert/path" # Path to WebP conversion script +``` + +## Usage + +Simply run the script: +```bash +./lumebuild.sh +``` +Set up as a cron job to run automatically: +```bash +crontab -e +``` +Add a line like this to run the script at your preferred interval: +```bash +*/5 * * * * /path/to/lumebuild.sh +``` + +## What it does + +1. Sets up Deno environment variables +2. Changes to the source directory +3. Commits any changes using Git +4. Runs WebP conversion if configured +5. Builds the site using Lume, outputting to the 'site' directory + +## Note + +Make sure the script has executable permissions: +```bash +chmod +x lumebuild.sh +``` + diff --git a/lumebuild.sh b/lumebuild.sh index 3f794d4..755a571 100644 --- a/lumebuild.sh +++ b/lumebuild.sh @@ -1,6 +1,6 @@ #!/bin/bash -LUME_DIR="/var/www/html/soulmining" +LUME_DIR="/your/lume/dir" SRC_DIR="$LUME_DIR/src" BUILD_DIR="site" WEBPSH="/your/webp/convert/path" @@ -17,6 +17,7 @@ git commit -m "`date`" if [ $? -eq 0 ]; then $WEBPSH cd $LUME_DIR || exit + # deno task lume --dest=$BUILD_DIR > /dev/null deno task lume --dest=$BUILD_DIR > /dev/null 2>&1 else exit 1 -- cgit v1.2.3