I’ve been stewing on this for quite a bit, but here is the (unsolicited) opinion of a content manager. Keep in mind this is mostly just spitballing. I also think Hugo is the best SSG out there and the only one that seems viable for publishing sites. I should distinguish that when I say “publishing,” I mean “more than just blogs, documentation, and portfolio sites,” which is the pigeonhole most SSGs seem to fall into. I also agree with @DerekPerkins: in a semver world, per-1.0 means breaking changes should (theoretically) be expected with the upcoming major release. Anyways, here are some thoughts:
- Other SSGs
- What is Hugo’s Focus?
- Source Organization and Content Sections
- What Can Hugo Learn from Other SSGs for V1?
Other SSGs
I’ve looked heavily into Hexo, Jekyll, Middleman, and Webhook. Jekyll and Hexo are great, but there are reasons you really only see them being used for portfolios, blogs (mostly for devs if we are being honest), small marketing sites, and documentation. Webhook is the best SSG I’ve used (here and here are some cool WH examples), but for less obvious reasons than the shiny UI and multi-level permissions:
- It forces you to follow best practice by content modeling (aka content typing, aka archetyping) first.
- It uses Swig, a powerful Django-based templating language (Jinja, Liquid [Jekyll], Twig [Craft CMS (a digital content manager’s wet dream), Drupal 8], Nunjucks [Hexo]) with easy methods for content relationships, template inheritance (blocks), etc.
But Webhook also has shortcomings (slow builds on larger sites, complex roll-your-own infrastructure, monthly costs) that are already obviated by Hugo.
What is Hugo’s Focus?
My first impressions of Hugo was that it’s strength was its focus on content. Page content will always be updated more frequently than layout or user interactions. Also, content should be done first, with presentation and interact coming later in any professional site. That said, I’d be interested in hearing what the owners of the project think about such a single-minded philosophy.@bep @spf13
- Is the content aspect of Hugo established enough to start incorporating presentation or behavior (css, js, preprocessors)? Eg, this pull request.
- Are such features necessary (ie, will Hugo be easier or faster than setting up a pipeline with Grunt, Gulp, or Webpack)? Do these facets of the build need to take place every time content is updated?
- Are variables and theming in CSS better handled via NodeSASS for statically generated websites (ie, content websites like those built with Hugo)?
@spf13 Treating each page as a folder with multiple files (ie, thereby making yaml/toml act more like an XML sidecar than EXIF in a JPEG) is smart. I also like @bep’s previous comments about “a page being just a page,” but I think these propositions betray some contentious (NB, not necessarily incorrect) philosophies about managing content at scale:
content != data
-
single-page != multi-content
(This is easy to negate by just looking at the average Wordpress site)
To expand on #1, here’s an empirical (ie, not scientific) review of different content habits:
<!---average writer using Markdown-->
# My First Article
Jon Doe
February 16, 2016
## My Heading
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<!--blogger,devs creating documentation,technical writer-->
---
title: My First Article
date: 2016-02-16
description: This is a description of my first article.
author: Jon Doe
tags: [first,article]
categories: [publishing]
---
## My Heading
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<!--content manager, web publisher, web editor-->
<!--content types, aka archetypes, aka content modeling; sorta as if archetypes are classes, and content are objects; or maybe thinking of it as archetypes as SQL tables and templating as joins? (Keep in mind that I am NOT a developer:) -->
---
title: My First Article
date: 2016-02-16
description: This is the description for My First Article
descrption_long: This is a longer description of My First Article that I can use in summary views or in list pages in different areas of the site where I don't want to be limited to a less-than-170-characters-for-seo sensibility.
authors: [Jon Doe]
categories:
- publishing
- web
- content-first
tags: [markdown, content management]
audience:
- publishers
- web
- writers
- technical
content: "## My Heading
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
---
<!--And then a sample from a controlled vocabulary at authors/jon-doe.md-->
---
name_first: Jon
name_last: Doe
name_middle: Joe
credentials: [BA, MA, PhD]
bio_short: This is a short bio of me, Jon Doe.
bio_long: Jon Doe was born in Anytown, USA. Blah blah blah blah blah blah blah blah.
image: ryan-watters.jpg
---
Source Organization and Content Sections
So, for example, a site might have the following structure/hierarchy when built:
index
+-- cats
| ...
|
+-- dogs
| ...
|
+-- birds
| ...
|
+-- locations
But use the following source organization when organized by content type and built with the ideal - let me qualify that this is just my ideal - SSG:
+--animals
|
+--stores
|
+--articles
|
+--authors
|
+--reviews
The templating in these cases is the sorta “join” between each self-contained piece of structured data/content. Jekyll’s approach to collections could provide insight into how Hugo might render individual content types, although it’s far from perfect and still documented as an experimental feature. That said, the current folder-as-global-navigation-item-as-site-section approach is, by default, simpler than the above example, but it can also be more limiting (cf. my introductory comment re: blog generators vs publishing solutions).
What Might Hugo Pull from Other SSGs for V1?
- This is a brazen, but Go templates deviate considerably from their more popular Django-and-mustache-based counterparts. I really think the simplicity of Liquid, and just sheer age and user base (obviously), is the only reason people use Jekyll more than Hugo. More robust templating could include a wider selection of
- Filters (eg,
| jsonify
)
- Functions (eg,
{{capture "capture_var"}}
)
- Inheritance (eg,
{{ block "content" }} {{ block extends "content" }}
)
- Easier management of relationships between content types. This is a tough one, but maybe something to the effect of a
{{ archetype.relationship}}
method.
- The ability to read to and write from all types of structured content (xml,json,toml,yaml,csv). Much of this is already supported in Hugo, which is awesome!
- Content management and utilities (eg, search, indexing, linkcheckers, etc), again, a lot of which is already being rolled out.
- Better documentation. This might mean a complete reorganization of the documentation structure and will come as a result of narrowing the focus - a la UNIX philosophy - of the project, IMHO. Since this is what I do a for a living, it’s also the one improvement I’m happy to help out with.
- Rather than embedding shortcodes or partials into the Hugo itself, it might be better for a library of the aforementioned to be decoupled and maintained by the community. Basically a repo of common use cases, which is sometimes the nature of questions on this forum (eg, “How do I pull up the most recently published article’s title based on the first tag used for such and such page?”). Otherwise, functions/partials/shortcodes are built out based on more narrow content models (eg, Disqus, which is ultimately for blogging, or social-media content types, which might not fit many publishing goals), and then you find yourself with a blogging engine rather than a publishing solution.
I’d love to hear feedback from the owners of this project. Thanks much to all. Hugo is freakin’ awesome.