From cdd2486e47eb2852acb59be8647349b5abb8f3e1 Mon Sep 17 00:00:00 2001 From: cloudartisan Date: Sat, 25 Apr 2026 15:23:57 +1000 Subject: [PATCH 1/2] Document current Hugo and content maintenance workflows --- AI.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/AI.md b/AI.md index 97dd3a04..ce27c50d 100644 --- a/AI.md +++ b/AI.md @@ -25,10 +25,22 @@ - Go is only required when changing Hugo module dependencies - Create new post: `hugo new content/posts/my-post-name.md` - Create new project: `hugo new content/projects/project-name.md` +- Create a post on a feature branch for PR review: `./scripts/create-post-pr.sh "Post Title"` ## Testing -- Preview site locally: `hugo server -D` +- Preview site locally: `./scripts/hugo.sh server -D` - Check links: `hugo server --navigateToChanged` +- Validate Hugo configuration: `./scripts/hugo.sh config` +- Check draft content: `hugo list drafts` +- Check future-dated content: `hugo list future` +- Test development build: `./scripts/hugo.sh --buildDrafts --buildFuture` +- Test production build: `./scripts/hugo.sh --minify --buildFuture` + +## Content Maintenance +- Movie data lives in `data/movies.yaml` and book data lives in `data/books.yaml` +- Update all movies: `python3 scripts/update_all_movies.py` +- Update all books: `python3 scripts/update_all_books.py` +- Install script dependencies: `pip3 install -r scripts/requirements.txt` ## Content Structure - Posts: content/posts/ From 224321d33198cc40b849b81b0270383ab72dcb0a Mon Sep 17 00:00:00 2001 From: cloudartisan Date: Sat, 25 Apr 2026 15:48:18 +1000 Subject: [PATCH 2/2] Fix post creation date timezone handling --- AI.md | 2 +- scripts/create-post-pr.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AI.md b/AI.md index ce27c50d..8f3e7699 100644 --- a/AI.md +++ b/AI.md @@ -25,7 +25,7 @@ - Go is only required when changing Hugo module dependencies - Create new post: `hugo new content/posts/my-post-name.md` - Create new project: `hugo new content/projects/project-name.md` -- Create a post on a feature branch for PR review: `./scripts/create-post-pr.sh "Post Title"` +- Create a post on a feature branch for PR review: `./scripts/create-post-pr.sh "Post Title"` (uses the site's `Australia/Sydney` date) ## Testing - Preview site locally: `./scripts/hugo.sh server -D` diff --git a/scripts/create-post-pr.sh b/scripts/create-post-pr.sh index cefa164a..30cc2a81 100755 --- a/scripts/create-post-pr.sh +++ b/scripts/create-post-pr.sh @@ -3,6 +3,8 @@ set -e +SITE_TIMEZONE="Australia/Sydney" + # Check if post title is provided if [ $# -eq 0 ]; then echo "Usage: $0 'Post Title Here'" @@ -13,13 +15,14 @@ fi POST_TITLE="$1" # Convert title to slug (lowercase, spaces to hyphens, remove special chars) POST_SLUG=$(echo "$POST_TITLE" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9 ]//g' | sed 's/ \+/-/g') -CURRENT_DATE=$(date '+%Y-%m-%d') +CURRENT_DATE=$(TZ="$SITE_TIMEZONE" date '+%Y-%m-%d') BRANCH_NAME="post/$POST_SLUG" FILENAME="content/posts/$CURRENT_DATE-$POST_SLUG.md" echo "Creating new post PR..." echo "Title: $POST_TITLE" echo "Slug: $POST_SLUG" +echo "Timezone: $SITE_TIMEZONE" echo "Branch: $BRANCH_NAME" echo "File: $FILENAME" echo "" @@ -67,4 +70,4 @@ elif command -v nano > /dev/null; then nano "$FILENAME" else echo "Edit $FILENAME with your preferred editor" -fi \ No newline at end of file +fi