Importance of Documentation
Note to self here, if you’re trying to maintain a blog, make sure you leave instructions to yourself about how to post new content, and make them easily accessible!
Step 0: Create a new blog post
Use the command hugo new posts/title-of-blog-post.md
to create a new file to write in. This will create a new file at $BLOG_ROOT/content/posts/title-of-blog-post.md
. In the file will be a title neatly auto-capitalised based on your filename, a timestamp, and a draft: true
attribute.
Step 1: Write the post
Use Markdown, remembering that for a newline you need to hit Return
twice.
Step 2: Change the draft attribute to false
Hugo will not publish any content in drafts, unless you use the --buildDrafts
flag, but then you have to remember to include that every time.
Step 3: Run the magical building command
Run hugo
in the $BLOG_ROOT
directory and all shall be resolved, with the content in the directory as set by the publishDir=../public_html
attribute in config.toml
.
Step 4: Bask in the glory of your new blog post
And just double check everything appears as you wish it to.
Step 5: Oops you need to grant permissions on the new file
Thank you Unix permissions very cool. Grant read permissions to the new index.html
file created in public_html
and maybe one day write a script to do this automatically.
Step 6: Well that wasn’t complicated at all
Life update: started new job. Going well. Can officially say “opinions are my own and do not represent those of my employer”. Going on a nice hike in the Peak District tomorrow.