Hacker News new | ask | show | jobs
by jacquesm 3864 days ago
Highly recommended, fast, simple to install (single binary), super responsive team if you find any issues and reliable. Compared to the jekyll/octopress/ruby ball-of-twine that it replaced (which would break at the most in-opportune times for no apparent reason) the speed increase is phenomenal, there is even a mode that re-generates the site on the fly on changes with a local server, it is so fast you can't move your eyes from one monitor to another while saving or the page is already updated. Of all the static site generators that I've tried it wins hands-down.
1 comments

I have not used it but one of the things I was concerned about is extensibility. I am unable to find any documentation on this. Due to it being in Go, is the recommend way to programmatically extend Hugo to make modifications in the Hugo source tree and recompile?
Hugo is built is a way that virtually everything you would want to do with a static site generator is configurable without go or recompilation.

Smashing Mag had a good write up explaining this http://www.smashingmagazine.com/2015/11/static-website-gener...

I am working on porting a mostly-data site to hugo now, and it has been a nice experience.

I did find myself wanting to introduce custom logic - like custom helper funcs for the Go templates - but there is no way to do this short of modifying and rebuilding hugo.

Specifically I wanted to use some functions from here: https://github.com/dustin/go-humanize

In the short run, it was fine. Since most of the data is structured I could write a script to modify the input data to prepare for output without modification.

Not sure about hugo's longterm plan for this type of thing, but overall it is an awesome project and would highly recommend over every other static site generator.

I know that Go is looking to add support for loading code at runtime, so a plugin system doesn't seem out of the question once it's landed.

https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGh...

You can embed parameters in the front matter, then pull that data back out in the templates, but I haven't actually done this see:

https://gohugo.io/content/front-matter/

That still leaves you with the problem of populating the front matter.

What would you like to do? 1-2 concrete examples please.
I have not used it so it is a bit unfair to ask for concrete examples of what I would need that it doesn't do. But in general, something like using the GitHub API (as my user) to obtain a list of recent commits to format a certain way could be an example.

But in all honesty my question was also wondering if this had a good story around runtime Go compilation since I am building a Go project that could be construed as a "static-binary generator" for an orchestration and configuration management system.

I've implemented the getJSON Feature http://gohugo.io/extras/datadrivencontent/ and this should be what you are looking for ;-)
One thing that I'd love to be able to do with Hugo (I'd probably switch from Middleman if this was possible): dynamic proxy pages:

https://middlemanapp.com/advanced/dynamic_pages/

"Middleman has the ability to generate pages which do not have a one-to-one relationship with their template files. What this means is that you can have a single template which generates multiple files based on variables."

So I can take a JSON file with an array of data, and generate a file dynamically for each object in the array.

Last I looked, I couldn't figure out how to do this with Hugo. Is it possible now?

Are the some examples on how to implenent a statically regenerated blog in a static site?