diff --git a/hugo-new.sh b/hugo-new.sh index 7f250e5..8fa3a1f 100755 --- a/hugo-new.sh +++ b/hugo-new.sh @@ -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