television

Television Station GTV9 Melbourne Australia

A collection of images, stories and memories.

Home 1956_1969 1970_1979 Reunions Stories Contact

Follow the instructions found on this site to “Create a clickable script”. Then use this code…

Notes:

  1. The code will prompt you to enter a name for your new post, avoid spaces and underscores in the name, use a dash instead, for example: my-new-post .

  2. You will be asked to input your system login password, this is to grant the script permission to move and create folders.

  3. You will need to edit the code to show your hugo folder name, and your system login username.

  4. After creating your new post you will then need to enter the title in the front matter of the index.md file.

Creating-a-post Creating-a-post

cd /

cd your-hugo-folder/content/posts

name="$(osascript -e ‘Tell application “System Events” to display dialog “Enter the post name:” default answer “"’ -e ‘text returned of result’ 2>/dev/null)” if [ $? -ne 0 ]; then # The user pressed Cancel exit 1 # exit with an error status elif [ -z “$name” ]; then # The user left the project name blank osascript -e ‘Tell application “System Events” to display alert “You must enter a project name; cancelling…” as warning’ exit 1 # exit with an error status fi

sudo mkdir -p $name

touch index.md

sudo cp /your-hugo-folder/themes/hugo-kiera/archetypes/posts-create.md index.md

sudo cp index.md $name

rm index.md

sudo chown -R username:staff /your-hugo-folder/content/posts

Script to create a post

Follow the instructions found on this site to “Create a clickable script”. Then use this code…

Notes:

  1. The code will prompt you to enter a name for your new post, avoid spaces and underscores in the name, use a dash instead, for example: my-new-post .

  2. You will be asked to input your system login password, this is to grant the script permission to move and create folders.

  3. You will need to edit the code to show your hugo folder name, and your system login username.

  4. After creating your new post you will then need to enter the title in the front matter of the index.md file.

Creating-a-post Creating-a-post

cd /

cd your-hugo-folder/content/posts

name="$(osascript -e ‘Tell application “System Events” to display dialog “Enter the post name:” default answer “"’ -e ‘text returned of result’ 2>/dev/null)” if [ $? -ne 0 ]; then # The user pressed Cancel exit 1 # exit with an error status elif [ -z “$name” ]; then # The user left the project name blank osascript -e ‘Tell application “System Events” to display alert “You must enter a project name; cancelling…” as warning’ exit 1 # exit with an error status fi

sudo mkdir -p $name

touch index.md

sudo cp /your-hugo-folder/themes/hugo-kiera/archetypes/posts-create.md index.md

sudo cp index.md $name

rm index.md

sudo chown -R username:staff /your-hugo-folder/content/posts