diff --git a/AI.md b/AI.md index 97dd3a04..8f3e7699 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"` (uses the site's `Australia/Sydney` date) ## 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/ 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