
Show HN: Gutenberg – A static site engine as a single executable - Keats
https://www.getgutenberg.io
======
sandGorgon
Hugo is written in go and does exactly this. Has a pretty large community and
themes already.

[http://themes.gohugo.io](http://themes.gohugo.io)

~~~
Keats
I'm aware of it, the majority of my static sites are still using Hugo since I
haven't touched them for ages.

The two features I really wanted when I started Gutenbrg were Sass compilation
and syntax highlighting built-in: a clean build of my blog with Hugo +
Pygments was taking ~20s for ~20 pages at the time and needed virtualenv for
Pygments, Node.JS/npm for gulp-sass and the Hugo binary. Hugo now has syntax
highlighting in Go so that part should be better though.

Themes are supported in Gutenberg but there is only one so far as I didn't
want to spend time on that yet. It is pretty fast to port themes though - took
me about 10 minutes for Hyde:
[https://github.com/Keats/hyde](https://github.com/Keats/hyde) \- so I might
port ~10 or so next week to get the ecosystem started.

~~~
dualogy
> _with Hugo + Pygments was taking ~20s for ~20 pages at the time_

That's long! Glad I wrote my own in Haskell (and I'm a Gopher! just did it to
get my feet wet in Hs) --- 92 pages in 1s (full rebuild; incremental is of
course just a fraction) feels good to me now.
[http://github.com/metaleap/haxtatic](http://github.com/metaleap/haxtatic)

No CSS magic tooling though. Just don't find vanilla CSS troublesome enough
yet =)

Edit: I saw you do ~10k pages in ~60s so guess we can see the Rust bonus there
now --- certainly beats my extrapolated expected ~5-6k for the same time-
frame. (Though I hope you were talking there about complex layouts with
component-like-sub-templates / programmatic sub-renderers and date-time
formatting, not just dumping-inner-markup-into-outer-markup =)

~~~
piranha
I would expect lower timings, see
[https://github.com/piranha/gostatic/blob/master/README.md#sp...](https://github.com/piranha/gostatic/blob/master/README.md#speed)

~~~
dualogy
In Go, sure. In Haskell, for some app use-cases (and I believe static-site-gen
is one such) it takes endless patience and tweaking to reach on-par
performance with let's say "systems languages". There's scenarios where
Haskell's lazy-evaluation may save a running program a lot of unnecessary work
theoretically, but in practice I found there's not too many, compared to any
eagerly-evaluated program written by a not-a-total-newbie-programmer.
Certainly not such batch text-file processing. Then you'd easily parallelize
your Go program wherever it makes sense, which in Haskell I didn't do but
relied on whatever magic the compiler sprinkles in (if any) via compiler-
options =)

Also I'm having a rather excessive template system there!

As long as it doesn't take 20s for 20p.. or I have to manage 10-100k-page
sites..

------
caio1982
Hey, just took a moment to tell you it takes courage to post a Show HN about
whatever it is that you built. I understand the tone of most of the comments
about Gutenberg in here, but... stick to your plan and just ignore them,
congrats for pushing something out of the door :-)

------
forlorn
Could you suggest a more general purpose static site generator? 99% of them
target blogs but most of times you need a bit more. Hugo looks like the most
advanced of them but its documentation leaves much to be desired and doesn't
include real-life examples of different projects.

I'd love to have a tool to generate a catalogue, a simple journal, etc.

~~~
llccbb
If you want lots of customization and are friendly with Python I would suggest
rolling your own project with Flask and Flask-Freeze. You get all the benefits
of complete customization from URLs to templated pages and scripts. Really
anything. While this isn't a canned solution, it is a really robust solution.

~~~
llccbb
Just to continue on...

With this setup you can have anything (ANYTHING!) powering the data side. From
CSVs to any SQL server local or remote, directories of markdown files,
directories of ZIP archives, random (or deterministic) numbers or generable
sequences.

Flask gives you so much freedom with the backend implementation you can draw
from anywhere. You just need to define the URL patterns and supply the
functions that respond with HTML. Flask-Freeze then crawls your site (or a
list of pages you specify) and renders the HTML with whatever function you
supplied. Couldn't be easier to understand and it is unbelievably flexible.

------
stephen82
One thing it would get people's attention would be how much time a compilation
test of 150K or more posts / pages would take to finish with Gutenberg.

That is something we, users, have discussed with the Nikola team and it's
something others have already discussed about it with other static website
generators.

Here's the discussion in case you are interested in:
[https://github.com/getnikola/nikola/issues/2842](https://github.com/getnikola/nikola/issues/2842)

~~~
Keats
I haven't really looked into performance that much yet but it is rendering one
of my bench site of 10k pages in 61s on my 4 years old laptop. Gutenberg does
load all posts in memory as well though so it's likely to run into the same
issue.

------
bemmu
Pre-compiled binaries:
[https://github.com/Keats/gutenberg/releases](https://github.com/Keats/gutenberg/releases)

Didn't notice those at first. Read the "installation" page, but jumped
straight to the subheading "mac os x" and thought it was unavailable.

Maybe you could have a"download for <Mac OS X/Windows>" button on the main
page that would lead to the relevant binary for the visitor's platform.

~~~
Keats
Good idea.

Hopefully someone will package it for Brew/Chocolatey (is that what is used on
Windows?) but it's a good stopgap solution.

~~~
eradicatethots
I think most people are still just running installers on windows

------
dctoedt
My first impression was that this was related to Project Gutenberg; that might
raise trademark issues.

~~~
jannes
Can you even trademark the name of a historic person like that? He's been dead
for 549 years.

Could I start using Einstein (dead for 62 years) or Galileo (dead for 375
years) as a trademark?

~~~
tomkin
Steve Gutenberg would differ in opinion.

~~~
virgil_disgr4ce
I believe the Stonecutters own the trademark on his name

------
corobo
I have a feeling the name will be drowned out with WordPress being in the same
market and their new editor also being named Gutenberg

~~~
poizan42
Wordpress? What about Project Gutenberg?

[https://www.gutenberg.org/](https://www.gutenberg.org/)

~~~
corobo
Not as new, not as likely to be in all the tech news

------
farhang
I do not honestly understand the negative comments, including the "Hugo did
that already" since the dev points to important differences such as SASS.

I very much look forward to testing the binary (not knowing Rust I see no
reason to try to play with the code). Just one preliminary feedback: gutenberg
--help does not indicate any options. But if I could make a suggestion that
might help set this apart a bit from other markdown-site-generators, it would
be to have real support for footnotes. Most seem to use the GitHub flavor
which is sorely lacking in that regard and it's unfortunate that most
generators do not address this vital need for many of us.

Thank you for your work and for sharing this project.

~~~
Keats
Footnotes are supported, an example in Phil blog: [https://os.phil-
opp.com/multiboot-kernel/](https://os.phil-opp.com/multiboot-kernel/)

Search for small hack and you can see one

------
leichtgewicht
The homepage misses how its different/better than all the other solutions.
Rust ftw?

~~~
Keats
For my own usecase, Sass and syntax highlighting built-in are the things I
wanted - Hugo now has highlighting built-in too though - and all of that in a
single binary. I don't want to mess with virtualenvs or JS packages.

Compared to Hugo (which is what I was using until then), it has:

\- the mentioned Sass compilation

\- a much better template engine (I'm a bit biased there since I also wrote
it)

\- assets colocations: keep images etc next to the post

I also find it much easier to use than Hugo but I wrote Gutenberg for my own
usecase so this point would need external validation.

I wrote a bit about the motivation when I released the initial version on my
blog: [https://vincent.is/announcing-
gutenberg/](https://vincent.is/announcing-gutenberg/) but I agree it should be
better communicated on the landing page.

Rust is an implementation detail: it could have been done in any language
compiling to a binary, I just picked the one I prefer.

~~~
weberc2
This is cool, and props for scratching your own itch, but this does seem like
an incremental/niche improvement over Hugo. I'm curious if you talked to the
Hugo community about supporting those features? I don't mean to imply that you
should have done so--"I wanted to build my own" is a totally valid reason not
to bother.

~~~
Keats
I don't really like the template engine available in Go (especially the
godawful one in the std) so I would have needed to write one or use pongo2 but
probably wouldn't have been accepted in Hugo:
[https://github.com/gohugoio/hugo/issues/1359](https://github.com/gohugoio/hugo/issues/1359)

The assets colocations issue was raised in 2014 and it might come soon but I
don't think it's there yet: [https://discourse.gohugo.io/t/keep-images-
content-together/5...](https://discourse.gohugo.io/t/keep-images-content-
together/51). Same thing for Sass compilation:
[https://discourse.gohugo.io/t/support-for-html-css-js-
prepro...](https://discourse.gohugo.io/t/support-for-html-css-js-
preprocessors/127)

~~~
scrollaway
FWIW I'm glad you wrote this. Having looked at Jekyll alternatives before, the
field is severely lacking especially in terms of static sites generators that
don't immediately assume you're publishing a blog.

------
bojanvidanovic
Just moved from Jekyll to Hugo and I'm planing to stay there. BTW it's nice to
see more alternatives to Jekyll coming on the scene.

------
dorfsmay
Ideally the perfect static site system should be a meta language, like one of
the wiki languages, for which several solutions could be used to translate to
HTML etc...

We shouldn't have to rewrite our blogs every time a new cool programing
language comes around!

~~~
kaushalmodi
Is this what you mean:

I write my blog posts in Org mode. So I wrote this package ox-hugo that
exports that to Markdown + the front-matter required by Hugo, in the folder
structure for Hugo.

Now I just write in normal Org, and don't worry about manually setting up the
post front-matter -- [https://ox-hugo.scripter.co](https://ox-
hugo.scripter.co)

(That site is generated by ox-hugo + Hugo btw :))

~~~
dorfsmay
Yes, although I'm not an emacs user.

I've been trying to pick a "meta language", eventually given up but I cannot
remember why, I need to pick it up again.

------
clintonb
Why should anyone use this over Jekyll or any of the numerous other static
site generators?

~~~
Cthulhu_
Jekyll doesn't work on Windows last time I checked, not without going through
a long list of steps. It also needs a Ruby runtime.

~~~
steveklabnik
It does work on Windows, and is fairly easy. It's true that it needs an entire
Ruby environment.

~~~
WorldMaker
WSL at least makes it a lot easier to maintain the ruby environment and keep
it up to date (especially for tracking GitHub Pages) as you can follow Ubuntu
instructions. Jekyll is definitely my largest use for WSL.

~~~
steveklabnik
That's true. I don't use the WSL anymore though, still works.

It is more annoying than something like Gutenberg would be though.

~~~
WorldMaker
Yes, for now the lazy convenience of being able to use GitHub directly as my
"CMS" makes it worth the hassle to work with Jekyll and Ruby in WSL for those
rare times when I need to do larger changes and make sure that I preview them
locally.

~~~
HugoBoss
This is a huge advantage for Jekyll, as it makes it easy to add new content to
my site from anywhere. I don't need access to my computer.

I wish GitHub would support other SSGs in the same manner that GitLab does.

------
HugoBoss
A couple small feature requests:

1) Can you add a guide to deploying on GH Pages, Netlify, S3, etc.?

2) A search feature, along with a theme/example showing how to integrate it

~~~
Keats
Both are definitely on the TODO list, I created
[https://github.com/Keats/gutenberg/issues/139](https://github.com/Keats/gutenberg/issues/139)
and
[https://github.com/Keats/gutenberg/issues/140](https://github.com/Keats/gutenberg/issues/140)
to track them.

------
Keats
I'll use the fact that people are watching this thread to ask for comments on
how to handle i18n on the RFC
([https://github.com/Keats/gutenberg/pull/111](https://github.com/Keats/gutenberg/pull/111))
as this is the next big feature I want to add.

------
laurent123456
As I'm familiar with PHP, I find it way simpler to just do `php somefile.php >
somefile.html`, then I don't need to learn a new templating language and go
around the quirks of a custom building tool. I guess it could make sense for
somebody who doesn't know any other templating language.

~~~
_jal
Or for someone who considers PHP a bucket of suck and avoids it whenever
possible. Or for someone who doesn't want the PHP dependency graph installed.
Or who likes the conventions of this one better than coming up with their own
or using some third-party PHP monstrosity with its own dependency graph. Or...

There are many reasons different tools exist.

~~~
wolco
2011 wants its memes back. PHP has changed, if you still have the opinion PHP
is a bucket of suck give it another try the tooling around php has changed so
much not to mention the language amnd speed improvements.

------
yoz-y
Is there any push to unify the way content is arranged so one could hop from
one static site generator to another?

I currently use middleman but I find it quite slow I might be tempted to go
somewhere else but I am putting it away because even the migration from v3 to
v4 of middleman took quite a while.

------
andrewmcwatters
There's a lot of me-too software out there, and honestly I wish that
developers would just be more candid about their goals.

What is this really? A state site engine with no dependencies... but is it?
...or is that just one of the things it is? If one had more plainly said "a
static site engine written in Rust" then maybe it would be more compelling to
at least one particular ecosystem.

I just don't understand the selling point unless you're completely candid.
Hugo is; it doesn't even pretend to be something it's not. It directly sells
to people who invest in Go. And Jekyll has a powerful stance as being
integrated with platforms like GitHub. What's the pitch here?

~~~
Keats
Why would an end user care which language the tool is made with? The only
times it matters is if they want to contribute or if it requires you to
install their toolchain, which is not the case here.

~~~
andrewmcwatters
It definitely has a larger impact with language ecosystems like Rust's and
Go's.

------
johnsoct
This name is already an amazing typography library...
[http://matejlatin.github.io/Gutenberg/](http://matejlatin.github.io/Gutenberg/)

------
seertaak
I have to say I don't really understand the point of these projects. Faced
with the problem of generating a static part for my website, I just used
Django to "print" the static part. I'm not saying you need to use Django
(although in my case it has clear advantages, namely that you write everything
using a single tool), but.... left pad, anyone?

~~~
BeetleB
>Faced with the problem of generating a static part for my website, I just
used Django to "print" the static part.

Because I don't want to spend too much time maintaining my site.

When I used Wordpress, it got hacked. I don't want to check every few months
for security updates.

When I used Django, it would randomly "go down" when some library changed on
my host. Then I'd have to figure out how to fix it. Which almost always
involved upgrading to the latest Django, which was never straightforward.

But the static site generator I have? Runs on my machine and not on a server.
I still have the same problems with it as with Django (upgrades breaking
stuff). The important thing is that it breaks stuff on my PC and not on the
server. People can still access my site while my generator is broken. I feel
no pressure to fix it (and indeed, it is usually months before I do fix it).

And, finally, I think you don't really know what SSG's do for you. It's not
about making one or a few pages static. It is about making it appear dynamic
while being static (tag pages, categories, etc). In fact, I would invert the
question. Given that a SSG can do pretty much anything a blog can do, why
would someone use a server side process to write a blog? What's the point of
having your blog in Django when a simple SSG will do the task for you?

~~~
seertaak
> When I used Django, it would randomly "go down" when some library changed on
> my host.

I haven't had that problem. Django is alright IMO, if a little "heavy" on
machinery. I'm not crazy about it, but it gets the job done and I do have a
soft spot for python :)

~~~
BeetleB
>I haven't had that problem. Django is alright IMO, if a little "heavy" on
machinery.

It might help to keep in mind that I've had Django running on a server since
around 2008. You can imagine that Django has changed a lot since then. Every
year or two the site would go down as the host would change their Python
libraries. So I'd need to update Django, which was always nontrivial if you're
changing from a version that was a few years older.

Perhaps Django is stable enough now that you can upgrade Django versions every
3-4 years and have it go smoothly. But not in those years.

Arguably, you could say I should have had my own Python + Django + all libs
installed in my user area and not have relied on my host's environment. Or
used a Django friendly host that provides this to you automatically.

At that point I'd go back to my question: Given that a SSG gives you a blog
right out of the box, why should I even consider Django? I don't want to be
constrained by hosts, and I don't want to have my own custom Python install
for each site I host.

------
HaoZeke
Please tell me there's some love for pandoc... I'm very confused though...
There's no mention of the markdown parser being used... Pandoc is essential
for cross-platform content (md --> doc, epub, pdf, html) and for MATH!!

Sadly, only Jekyll and Hackyll have support for it... (many other smaller
projects also might)

Hugo with npm scripts does exactly thins...

------
quickthrower2
I now prefer knocking stuff up in my pet chosen MVC web framework. I can be
more more productive when I need to tweak thing that way.

With output caching performance should be on par with static. Or can use one
of those programs that downloads a website to convert into static files if
required.

------
cdevs
Do any of these static generators keep configs and themes with wherever you
happen to upload your static content "example: github"?

Just curious if moving from one machine to another if it's easy to download
something like Gutenberg , clone your git and start working?

~~~
kaushalmodi
Once you get confident with your static site generator, you don't even have to
download it or run it locally (not kidding).

I have my Hugo-based blog on Gitlab (content, themes, config, etc).

I just need to commit changes to my plain text content (Org/Markdown) ->
Netlify sees the commit -> Runs hugo to generate the site -> Site gets
published.

------
djcollier
Very nice, that is one of the most annoying things about Jekyll. I know i'm in
the minority of users here who is on Windows, but setting up a Ruby in
environment is a pain. Nice work, the site is also well designed.

------
eterm
Does anyone know why the page flashes when clicking "Docs" at the top, but not
when moving to the "installation" link on the left hand side which is the same
url?

~~~
ARCarr
Because the "Docs" link at the top goes to a blank page that then redirects
you to the installation page.

------
krick
I don't see a point right now, but just in case: how much of a hassle would it
be to migrate my Hugo-based projects to Gutenberg, if it proves to be more
useful somehow?

~~~
Keats
If you're using a TOML frontmatter it should be pretty painless for the
content otherwise a bit annoying. Migrating the theme/template should be fast
though.

------
groovy2shoes
No dependencies? Then what's all this?

    
    
        [dependencies]
        clap = "2"
        chrono = "0.4"
        toml = "0.4"
        term-painter = "0.2"
        # Used in init to ensure the url given as base_url is a valid one
        url = "1.5"
        # Below is for the serve cmd
        staticfile = "0.4"
        iron = "0.5"
        mount = "0.3"
        notify = "4"
        ws = "0.7"
    

Not to mention the Rust toolchain!

You and I must have different ideas of what constitutes a dependency ;)

~~~
Keats
The output binary has no dependency. The dependencies listed and Rust are only
necessary if you want to build from source.

~~~
groovy2shoes
I figured that's what you meant :)

I apologize if I came off as dismissive or disdainful; I was in a sort-of
playful mood when I wrote that, but moods don't usually survive internet
transmission!

It's a neat project. I myself don't have much use for a site generator of any
sort, but I _am_ interested in Rust (though I haven't had much opportunity to
use it in the last year or so). I wonder: how are you liking Rust as a
language? as an ecosystem? For a project like this, what advantages has Rust
afforded? what disadvantages?

------
dangom
Are there examples of pages generated with Gutenberg?

~~~
Keats
The site is built with Gutenberg so you can open the inspector to view some.

~~~
davidpelayo
However, it would be nice to have some at the source code.

~~~
slig
It's on the repo
[https://github.com/Keats/gutenberg/tree/master/docs/template...](https://github.com/Keats/gutenberg/tree/master/docs/templates)

