Alfred workflow for Hugo, a static site generator.
This workflow provides shortkey for markdown document to hugo post migration, creating new hugo post and one-click deployment.
If you do not know hugo, please check https://gohugo.io/getting-started/.
First you should set your hugo source folder using hugoset
:
This command will set this folder's path in environment variables.
If your source folder is changed, you must set it again.
If you want to migrate your existing markdown docs to hugo posts, use hgtran
:
Then this file will be copied to hugo-source-folder/content/posts/
and a simple hugo front matter will be added to the head of the post file. The post file will be automatically opened for you:
You can create a new hugo post using hgnew
:
Note that you CANNOT use filenames with whitespaces here. Pleaee use -
to replace whitespaces -- don't worry, those -
will be replaced by whitespaces in the post title.
Similarly, the created file will be opened automatically with a simple hugo front matter:
Before deploy your site, make sure you have deploy.sh
in your hugo source folder and you can deploy your site using ./deploy.sh
in the root of your hugo source folder. Please check hugo's official doc first.
Use deploy
in Alfred to deploy your site:
The Alfred will automatically open the terminal and run the deploy script:
This workflow is in a very early stage, any kinds of contribution are welcome!
Please feel free to open an issue if you have any questions or suggestions!