Skip to main content

How-To

Automate HUGO labnotes

·177 words·1 min
Use a Shell function (recommended — zero dependencies) # Add this to ~/.zshrc: labnote() { local slug="${1:-}" if [[ -z "$slug" ]]; then read "slug?Lab note slug: " fi slug="${slug// /_}" # spaces → underscores (cd ~/code/thetasigma-site && hugo new "lab-notes/${slug}.md" && code "content/lab-notes/${slug}.md") } Then labnote thetasigma_labs_setup or just labnote and it prompts you. Opens it in VSCode immediately. This is almost certainly what you want — it’s a 30-second setup and you never leave the terminal.