From 53cedfb96b9877031f8edb296a22d5d84eb8ae9b Mon Sep 17 00:00:00 2001 From: Anne Date: Sat, 1 Nov 2025 10:56:35 +0100 Subject: [PATCH] Edited post Hugo workflow --- content/posts/hugo-workflow.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/content/posts/hugo-workflow.md b/content/posts/hugo-workflow.md index d8bb07c..1523fcd 100644 --- a/content/posts/hugo-workflow.md +++ b/content/posts/hugo-workflow.md @@ -1,28 +1,31 @@ +++ title = "The appeal of wysiwyg" author = ["Anne"] -date = 2025-10-31T00:00:00+01:00 -lastmod = 2025-11-01T00:10:49+01:00 +date = 2025-11-01T00:00:00+01:00 +lastmod = 2025-11-01T10:53:49+01:00 tags = ["hugo", "workflow"] draft = false +++ -For a DIY kind of girl like me, [Hugo]() is the best. Hugo is a static website generator that gives you complete control of its output --- right from the command line. What more could a girl wish for? +For a DIY girl like me, [Hugo]() is awesome. Hugo is a static website generator that gives you complete control over its output --- right from the command line. What more could a girl wish for? -Even better, you can use your [favorite text editor]() to write new content or tweak your theme. While I love the command line, I do understand the appeal of wysiwyg: it's nice to be able see how your content will look before publishing it online. But do you really need a full-blown content management system with all the bells and whistles for that? Nope, actually you don't. Hugo can help you out just as easily! +Even better, you can use your [favorite text editor]() to write new content or tweak your theme. While I love the command line, I do understand the appeal of wysiwyg: it's nice to be able see what your content will look before publishing it online. But do you really need a full-blown content management system with all the bells and whistles for that? Nope, actually you don't. Hugo can help you out just as easily! ## My workflow {#my-workflow} -So what does my workflow look like? In a nutshell: I create some new content on my laptop, check out how it renders locally in my browser, and when I'm satisfied, push it to [Gitea]() --- which automaticaly deploys it online. +So what does my workflow look like? In a nutshell: I create some new content on my laptop, check out how it renders in my browser locally, and when satisfied, push it to my server --- which automaticaly deploys it online. -Preferably, I write in Emacs, typing away on my laptop sitting somewhere cozy, with a cup of coffee within reach. On my laptop, I have a local repo clone of my blog. The git repository lives on Gitea on my private server, which also serves my blog to the world. +Preferably, I write in [Emacs Org Mode](), typing away on my laptop sitting somewhere cozy, with a cup of coffee within reach. On my laptop, I have a local clone of my blog. The main git repository lives online on [Gitea]() on my private server, which also serves my blog to the world. + +> Note to self: write a post about magically deploying a static website with Hugo, Gitea and webhooks. Before I start writing, I `cd` into the root of my local copy of my blog's repository and fire up the Hugo web server: ```sh { linenos=false } +cd ~/projects/blog.minded.net hugo server --buildDrafts --navigateToChanged ``` @@ -37,12 +40,14 @@ hugo new content posts/my-new-post.md emacs content/posts/my-new-post.md ``` -Every time I save my changes in Emacs, ox-hugo exports the org files to markdown files for Hugo. The Hugo server then renders the new content, so I can immediatly see what my writings look like in my browser. Wysiwyg enough for me! +Every time I save my changes, the Hugo embedded server renders the new content on the fly, so I can immediatly see what my writings look like in my browser. Wysiwyg enough for me! + +> Side note: Hugo supports several [content formats]() out of the box. [Markdown]() is the default format, but it also supports [Emacs Org Mode]() and other formats. I really love Org Mode, together with [ox-hugo]() to export my Org files to Markdown for Hugo. Maybe I'll circle back on that in another post. ## Get it out there {#get-it-out-there} -When I'm done writing, I commit and push my edits to the repository in Gitea: +When I'm done writing, I commit and push my edits to my main repository on Gitea: ```sh { linenos=false } git add content/posts/my-new-post.md @@ -54,4 +59,4 @@ Gitea then automagically gets Hugo to rebuild my blog and publish it online. It Note to self: don't forget about `draft = true` in the [front matter]() of my new post :P -If you are curious, you can find the source code of this blog here: . +If you are curious, you can find the repo of this blog here: [git.minded.net]().