Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion AI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
7 changes: 5 additions & 2 deletions scripts/create-post-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand All @@ -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 ""
Expand Down Expand Up @@ -67,4 +70,4 @@ elif command -v nano > /dev/null; then
nano "$FILENAME"
else
echo "Edit $FILENAME with your preferred editor"
fi
fi
Loading