No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

new 421B

12345678910111213141516171819
  1. #!/bin/bash
  2. # Uses Hugo to create a new post based on the current date and the provided title
  3. # e.g., new my-awesome-blog-post will create content/YYYY/MM/DD/my-awesome-blog-post/_index.md
  4. # Require one argument
  5. if [ $# -eq 0 ]
  6. then
  7. echo "Usage: new <title-of-post>"
  8. exit
  9. fi
  10. datePrefix=$(date +'%Y/%m/%d/')
  11. postTitle=$1
  12. pathSuffix="/index.md"
  13. postPath="$datePrefix$postTitle$pathSuffix"
  14. hugo new $postPath