butiran

np script

· 1 min read · edit

Create new Hugo post, add it to Git, and open it with CotEditor.

#!/bin/bash

if [ -z "$1" ]; then
  echo "Usage: $0 <path/to/file/post-title.md>"
  exit 1
fi

POST_PATH="$1"

# Create new post using Hugo
hugo new "$POST_PATH"

# Add the post to Git
git add "$POST_PATH"

# Open the post in CotEditor
cot "$POST_PATH"

notes

  • There is a confusing discussion due to misprompting or something else 1.
  • Rename it from sript np to np scipt for better searching using Finder on macOS. It is on 21-dec-2025.

refs


  1. GPT-5, “Hugo automation scripts”, ChatGPT, 20 Nov 2025, url https://chatgpt.com/share/691e3420-c5e4-800a-9f87-5429af16e821 [20251120]. ↩︎