In this video I’ll walk you thru my HuGo - Netlify workflow. Hugo is a static site generator written in the Go language and uses Markdown files for its content.
Transcript (English)
Hello YouTube, this is Cristian Herrera. I hope you had a fine Easter despite the pandemic. Here in Stockholm it’s cold and snowing, so I’m on my boat working for a client. Before I start, here’s a quick look at my Hugo + Netlify workflow for updating the blog.
Hugo is a static site generator. I moved my blog from Joomla to Hugo. I’m turning my video posts into blog posts; later I’ll use YouTube subtitles to create full posts, but that’s a future project.
Hugo recommends creating new content with the hugo command—it creates the path and a boilerplate from archetypes/. I have a custom archetype with title/date/lastmod. But I often do it manually: under content/blog/<year>/ I create a folder per post with index.md inside. Hugo handles image resources better with that bundle layout. I usually copy an existing index.md into the new folder (e.g., content/blog/2016/enlightenment-basic-configuration/) and edit it.
Workflow:
- Run
hugo serverfor live preview; any change in Markdown orconfig.tomlis visible immediately. - Copy an old
index.mdto the new post folder; edit title, tags, categories, date, and the YouTube link. - Check the dev site to see the post with correct date, tags, categories, and embedded video.
- For production: run
hugo --minify(minifies HTML/CSS; watch out for JS that can break when minified). Output goes topublic/. - Deploy to Netlify via CLI:
netlify deploy --dir=public --prod(mynetlify.tomlpoints topublicas the publish directory).
After deployment I check the live site: the post appears in “posts” with the correct date. That’s my current workflow; Hugo + Netlify is working great for me. Have a nice day and stay safe—bye.