Correct branch naming with slugs
This commit is contained in:
+4
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user