Let’s celebrate Hugo’s 5th birthday
gohugo.io
gohugo.io
But.
Like most of the static site generators out there, it is so hyper-focussed on some aspects that it stumbles or completely misses others. I believe that Hugo (and others) take Markdown in precisely their expected format, and layout, with their format of header and, with precisely the correct version of config file and template.. turn it into some really nice looking HTML. Fast.
I guess - even after 5 years they aren't attempting to call it 1.0 at least. Maybe the other things will get fixed before then.
You might even be able to take your existing Markdown stuff and convert it - but be prepared to fiddle with Markdown syntax a bit, and headers, and file layout, etc.. potentially for hours. And hours and hours. And hours and hours. Not so fast any more, is it? Hugo is not alone here.
The number of themes available is amazing! And they look fantastic! But - you're going to have to spend many more hours digging to find one that puts the blog on a separate page, instead of front and center.. because 80%+ of them are oriented towards blogs only.
Now.. a week later... new minor release time. Does the new release work with your existing config? With your existing theme?
Oops - you waited a month and missed a few minor releases.. will everything break now? How do you ensure that your theme keeps up to date with your release? Git hooks, git submodules? What fun! How.. fast? Not if you're futzing with all this stuff.
Hugo isn't alone here - Jekyll, Pelican to name two I've tried also have problems to a greater or lesser degree.
I use Pelican. It supports markdown and rst out of the box. It's fairly easy to write a plugin to support another format. So I wrote one that takes in Org files (I think it just uses pandoc behind the scenes to convert to rst). Writing posts is much better now that I can author them in Org mode.
So if someone wants to author in Org mode, but not use the clunky Org exporters, consider using a static site generator that allows you to have a custom input format.
I actually have it customized to put some CSS in, but it is suboptimal.
(setq org-html-doctype "html5")
(setq org-html-head-include-default-style nil)
(setq org-html-head
(concat "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<link href=\"https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.css\" rel=\"stylesheet\">
<style>" (string-from-file (concat eddie/default-emacs-dir "style.css")) "</style"))
(setq org-html-head-include-scripts nil)ox-hugo basically lets each tool to do what they are best at: Org mode deals with the rich markup and Emacs/Elisp processing, and Hugo deals with the super-fast Markdown->HTML conversion.
[1] ox-hugo is an Emacs package that exports from Org mode to Markdown format that's compatible with Hugo/Blackfriday + automagically converts natural Org metadata to TOML/YAML front-matter.
Hugo works fine out-of-the-box with markdown files that don't have any headers. You'll just be seeing some reference errors for things like Title, probably.
And moving the blog to a separate page wouldn't take hours. The homepage comes from `layouts/index.html` [0], and each type of page already has a list page ( `page_type/_index.md` ).
Not sure if it'd really take that much longer to get your head around how Hugo works versus a traditional CMS. At least with a static-site generator, if you keep it outdated (and therefore don't need to bother with any breaking changes), any unfixed vulnerabilities aren't facing the web.
I just want to turn my markdown into pretty HTML. That's all. Jekyll feels like this giant sledgehammer that's built to hit a tiny nail... and doesn't even hit the tiny nail correctly every time.
If you're not looking for a static site generator, maybe Pandoc is more what you're seeking?
Upgrading from one version to another has been painless as well so far.
I wanted to automate the upload process too so I made something that is somewhat but not quite rsync-like (it uses a date and size heuristic to do fast incremental updates) - and then for the site content I realized that Hugo's design was resistant to text + image bundling, favoring static data independent of markup. The documentation on making a bundle work from within Hugo was both extremely limited and actually broken on current versions.
So I just rolled another script to publish content with. All it does is pre-process the Markdown and copy files.
Still, by going this route I'm still gaining advantages over the old system. It's nice to have a system that takes care of common stuff - themes, list generation, final markup. But it's much more valuable when it's supplemented with a custom system that lets me author the content at the level of abstraction I need.
You: > I believe that Hugo (and others) take Markdown in precisely their expected format, and layout, with their format of header and, with precisely the correct version of config file and template.. turn it into some really nice looking HTML. Fast.
The post: > Currently, in addition to Hugo’s list pages, every URL must be backed by a content file (Markdown, HTML etc.). This covers most use cases, but we need a flexible way to generate pages from other data sources. Think product catalogues and similar.
You: > I guess - even after 5 years they aren't attempting to call it 1.0 at least. Maybe the other things will get fixed before then.
The post: > Hugo has stuck with the sub-zero versions to signal active development ... But we are closing in on the first major stable version.
You: > Now.. a week later... new minor release time. Does the new release work with your existing config? With your existing theme?
The post: > with a new main release every 5-6 weeks. But we take stability very seriously (breaking things add lots of support work, we don’t like that) and most site upgrades are smooth.
Words in a blog post are easy to write, the proof is in the actual use of the software. But equally, to me this post strikes a positive tone about the future of Hugo as more than just a tool that helps you ditch WordPress. A lot of that work will have already started and I'm sure they would welcome your contributions, large or small.
I've recently moved to Gutenberg[0], which is very nearly a clone of Hugo except for the templating language. After some benchmarks[1], I concluded that it's even faster than Hugo, and the ergonomics of using the templating language are far, far better.
I would also mention that sometimes the Go internals leak and it is also not convenient.
That's very subjective. It's templating language is one of the reasons why I use Hugo. It reminds me very much of Lisp ({{ or $foo $bar }}).. parens replaced with double curly braces.
Now, everyone doesn't like Lisp :)
Why would we do that? Text manipulation (translating from a simple markup format into HTML) is Perl's bread and butter! And make is pretty easy to set up to have new general-purpose rules (e.g. .md -> .html).
i thought my (dynamic) blog custom-built in php was the bee's knees because i could have comments and my own admin interface. how silly i was. =) particularly with the advance of front-end development (and automatable deployment pipelines), static generation makes so much more sense now.
I assumed you'd rolled your own as TT doesn't require Make.
Maybe we need a hybrid site generator. We could still write the content as seperate text files, but we would have the ability to integrate comment sections, user profiles etc. seemlessly.
Our posts could be parsed and recorded onto a database, for better indexing, search, analytics and reducing redundancies.
The generator would come with a web server and handle everything we throw at it. From ssl to comments to databases.
That's the future I dream of. Not full blown CMSs, but not web 1.0 either.
It's not ideal, but it is as close as I have come to showing someone an article and asking for their comments IRL.
The Forestry.io blog has a number of articles covering some of these topics:
* eCommerce – https://forestry.io/blog/snipcart-brings-ecommerce-static-si...
* Search – https://forestry.io/blog/search-with-algolia-in-hugo/
* Forms – https://forestry.io/blog/5-ways-to-handle-forms-on-your-stat...
* Advanced Image Handling: https://forestry.io/blog/master-image-delivery-with-cloudina...
* Building APIs – https://forestry.io/blog/build-a-json-api-with-hugo/
Regarding user profiles, the Forestry website itself is built with Hugo and has a Rails app to handle profiles.
EDIT
I know you don't want to rely on third party services, but if it's possible to handle this with third party services then surely open source alternatives could be built.
However, building out a user account system this way is probably theroetically doable, but definitely not practical.
[1] https://discourse.gohugo.io/t/static-site-behind-login/10100
And while it’s build-speed is impressive, I’m of the mindset that if your site is large enough that build-speed is a genuine concern, rebuilding your site every time you make a change is a bad idea, and perhaps a dynamic tool is a better fit for the job.
Has anyone used Hugo for something other than a blog? I am looking for some stories like using Hugo as a REST-API or anything other more creative similar to this:
Most of the Gatsby time is usually doing bundling of css, js, etc with Webpack. I would imagine if you did that with a Hugo site you would run into the initial 15-20 seconds to bundle & then a few seconds to convert all your markdown pages into static HTML pages.
That said, I would assume Hugo still wins but not by near as much.
So you can argue that Hugo is much faster, if you don't have a use for Webpack on your site. If you don't want the fancy bells & features Gatsby provides, you should for sure pick Hugo over it.
current benchmark: 25000 pages in 32 seconds.
There's also the option to create your own https://gohugo.io/themes/creating/
You may wish to specify your exact requirements.
I’ve been pretty happy with Hugo so far.