How I did it

I recently wrote a Python app for creating a basic HUGO post, front matter and post.md file in content directory.

Then I decided to make an icon on the desktop to launch the code.

This is what I did:

These instructions are for MacOS not Windows:

The main thing is to create a shell script that runs the python file and then copy it to the desktop and remove any extension like .sh

Next CMD I on the icon and drag a new icon into the properties, top left.

This is the contents of my shell script:

    1 #!/bin/sh
    2 echo "Running Post Creator"
    3 cd /Users/mark/HugoPostApp
    4 python3 app.py
    5 echo "Done"

This will then launch the terminal and run the script.

To close the terminal after running: go to the Terminal settings set When the shell exits: to close window on clean exit.

Terminal Settings

I may share the python HUGO post creation file eventually, once I am happy it is stable.

Comments are off on this site, if you wish to say something you are invited to do so via Mastodon