Hacker News new | ask | show | jobs
by Animats 3853 days ago
It looks like it's basically a markdown to HTML translator, with a scheme for specifying formatting in YAML. It's almost easier to write HTML by hand.

(I still use Dreamweaver 8 for static pages. They render just fine with modern browsers.)

1 comments

It's easier to write HTML by hand if you only have a few pages. But if you have a few hundred or a few thousand pages a site generator can save you a lot of time and sometimes your sanity.
Apart from that, separating content and design can also be a big deal for working with different kinds of tooling.

You can use hugo to fetch JSON, YAML or CSV data from remote URLs and use those data as part of the build process. And if you use local data files instead of HTML you can use a tool like netlify-cms (github.com/netlify/netlify-cms) to give end users an easy way to work with that structured data without ever touching text editors or the like...

And as jacquesm said, once you have a more complex site with lots of pages, you'll want to use partials, reuse content in different places (show a summary of an article on an index page, full article inside, small blurbs on the homepage, etc), and once you get there you really don't want to write HTML by hand...

Oh wow, I just looked up their doco, and found the csv and rest connectors. Thank you so much for this. Had I known I may not have built a recent parts database website with harp.js and a weird mashup of php, bash and even a go sitemap script. Dumping out csv files from excel, iterate through said csv files with php and dump ejs files with part (628 in all) then harp compile followed by an s3 sync for all 633 pages on the site. All scripts referenced from one bash file. I felt clever! But won't feel clever when I rebuild my Mac with X number of environments (npm, php, aws sdk, OSG) to build the site. With Hugo and also stout [1] also mentioned here, the workflow is alot more predictable, and binaries could be kept in the project for easy portability.

Also worth mentioning is OSG [2], a sitemap generator written in go that I use in my bash script. It's very fast. This may have some advantages over hugos built in sitemap generator depending on your site, though I think I would use hugos in most cases. Might be useful for others using other static generators that don't support sitemaps and also have other CMS's and carts / forums installed too.

[1] http://stout.is [2] https://github.com/patrickmn/osg

You're welcome! And give netlify a try (I'm a founder). For a large site with hundreds of interlinked pages, S3 has the problem that there's no good way to do atomic deploys (what they call all-or-nothing consistency for whole deploys in the stout documentation).

Netlify will make sure you get true atomic deploys where no changes go live before all changes have been uploaded and handles instant cache invalidation.

We have built-in support for hugo for our integrated continuous deployment system, and can do builds triggered by webhooks. So for any setup where you're building based on external files, you can easily trigger rebuilds whenever one of those datasources gets updates...