Correct branch naming with slugs

This commit is contained in:
Andrew Stryker
2026-04-20 08:46:30 -07:00
parent 2f75dd84cd
commit 24cba59620
+4 -3
View File
@@ -33,13 +33,14 @@ DATE=$(date +"%Y-%m-%d")
# Convert title to a URL-friendly slug (lowercase, dashes)
SLUG=$(echo "${TITLE}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
POST_SLUG="posts/${DATE}-${SLUG}/index.${EXT}"
POST_SLUG="posts/${DATE}-${SLUG}"
POST_SLUG_EXT="${POST_SLUG}/index.${EXT}"
# Construct post directory
POST_DIR="content/posts/${DATE}-${SLUG}"
POST_DIR="content/${POST_SLUG}"
# Generate the new post with the selected archetype
hugo new --kind "$KIND" "${POST_SLUG}"
hugo new --kind "$KIND" "${POST_SLUG_EXT}"
HUGO_EXIT_CODE=$?
# Validate Hugo execution