DEV Community

Cover image for Best Static Site Generator to use in 2020

Best Static Site Generator to use in 2020

⚡ Nirazan Basnet ⚡ on February 04, 2020

Static site generator is a compromise between using a hand-coded static site and a full CMS. You generate an HTML-only website using raw data (such...
Collapse
 
leob profile image
leob

Gatsby docs talk a lot about their output (pages) being super fast and including all kinds of tricks to squeeze the last drop of performance out of their static pages. I can't judge the technical merits of it but it's clear they've put a lot of effort into that. Hugo (being written in Go) is probably fastest with page generation though.

Collapse
 
leob profile image
leob

I think that Gatsby is turning out to be the "de facto standard", it's so well conceived and executed, with a huge ecosystem, I feel it makes the rest obsolete.

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

But I thought HUGO and Gatsby are the great combinations to learn, anyway thanks for sharing :)

Collapse
 
leob profile image
leob

A work colleague of mine is into Hugo and I believe it's cool as well. Programmed in Go and extremely fast.

Collapse
 
rolfstreefkerk profile image
Rolf Streefkerk

we use Hugo, it's fast and you can embed it easily in a CI/CD chain with your source code to auto-generate updates

Collapse
 
nham profile image
Nick • Edited

Full disclosure, creator/developer of Nift here.. You can reasonably easily embed Nift in a CI/CD chain similarly and it's even faster. It can be over 4 times faster at full builds and can be over 20 times faster during development from having incremental builds.

I've recently released some huge new versions with an in built template language n++ and in built scripting language f++, both of which use basically the same code so are very similar and have user-defined functions, full type systems with user-defined types with templates types (eg. templates in c++) etc.. Both in built languages have CLI interpreters and shell extensions, the f++ shell extension is getting really good! It also now has Lua(JIT) embedded in it so you have a full programming language that's often in top 20 programming language lists at your disposal, including all the packages you can install through LuaRocks that can be useful for web development, see here for example. It also has ExprTk embedded in it which is probably the fastest and best mathematical expression parsing library available.

You can inject the output of running scripts/programs/system calls at any point when building webpages which allows you to integrate with basically anything you want. I am just working on adding in pagination at the moment. If it all sounds interesting to you, wait a few days until v2.3 is out (watch out for pagination docs on the website) and give it a try! Am happy to schedule time to help people start getting their hands dirty with Nift too if anyone is interested, email me (contact@n-ham.com).

Collapse
 
rolfstreefkerk profile image
Rolf Streefkerk

at the moment the sites that use Hugo cant just easily be transformed into using another platform. There has to be a serious reason for me to consider putting in days or maybe weeks of effort to redo all of it. So far Hugo works for what we need it do.

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

:)

Collapse
 
ajeet profile image
Ajeet Yadav

Thank your for this post Nirazan.

I also recommend everyone to use this site, maintained by Netlify

staticgen.com/

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Thank you for sharing this site. :)

Collapse
 
diek profile image
diek

Wow ty!

Collapse
 
iteachfrontend profile image
iteachfrontend

Our favorite is Gatsbyjs - you get a chance to work with Reactjs and all those modern tools out there.

Hugo is another one that is simple and blazingly fast

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

GatsbyJs is awesome too :)

 
leob profile image
leob • Edited

Wait a moment, I guess that you know more about Gatsby than I do, but isn't it so that, as a SSG, Gatsby normally outputs static HTML pages?

So that's not your conventional SPA - it's more like an old fashioned static HTML site. What do you mean then by the bundle size being "larger than an SSG"? Even though you program your Gatsby site with React, the output normally isn't a React app.

(hydration, as I understood it, can then optionally overlay a React app on top of it, if you need 'dynamic' behavior, but this is optional - but I might be misunderstanding what hydration means, I'd need to read up on it)

The "speed tricks" (techniques) that they're referring to are things which improve your site's metrics in Lighthouse etcetera - optimizing images, the way CSS and other resources are bundled and loaded, and so on.

 
leob profile image
leob • Edited

Love your enthusiasm, thanks buddy ... dev.to has a chat function built in doesn't it? yes it does, I should be able to hit you up on "dev.to chat" ... I followed you, if you follow me back then I'll be able to message you ... I'm off to bed soon however, let's do that tomorrow :-)

Collapse
 
esspetess profile image
Yih Sev

Hi Matt. I'm trying to build just simple portfolio websites for my friends. I specialize in Javascript and I'm comfortable with CSS too. I don't usually build websites since it's not what I do at work. I'm not yet sure what SSG to use. Would you recommend 11ty over HUGO?

Collapse
 
simoneb1x profile image
simoneb1x

I'm not that expert web developer and I'm actually using Jekyll for my personal blog. I find it very easy - also for customising CSS. I also tried GatsbyJS and it's incredibly fast! But ReactJS must be well known.

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Keep exploring and thanks for your thoughts :)

 
leob profile image
leob

Yes now I see your explanation I think it does make sense, thanks!

That's an eye opener. What's funny is that most blog articles and even the Gatsby docs themselves suggest (or even state) that Gatsby actually generates a static site and not an SPA.

I think that's not intentionally misleading or wholly inaccurate, it's just a technically simplified description. The way you explain it is the "accurate" version :-)

I now understand why you said that the bundle size is bigger (and why that's true).

So when you think about what Gatsby is doing it's pretty nifty, giving you the "illusion" of a static site (and actually all of its advantages, in terms of speed and SEO) but at the same time allowing SPA like capabilities. It's like "having your cake and eating it too" :-)

 
leob profile image
leob

Right, but Gatsby (as you said) also "pre-generates" static pages (which are then subsequently hydrated to give full SPA capabilities), so the "time to initial page view" would also be quick with Gatsby - right? Javascript then needs to be loaded to make the page interactive but the content would already be there.

The way I see it (correct me if I'm wrong) is that Gatsby is more like a hybrid, it's SSG + SPA, while Hugo etcetera are pure SSG / static (you could then still include Javascript in those pages but it's not part of the "framework").

But if you develop a Gatsby page (or site) which doesn't need any interactivity then it would also not need "hydration" or would it? You then essentially have the "Hugo" model.

You also mention Nuxt.js, but I thought that was based on SSR (server side rendering), same like Next.js, although I heard that Nuxt and/or Next also have an "SSG mode" (so they can do "server side rendering" but 'in advance' instead of 'just in time'). But in principle SSR frameworks like Nuxt and Next need a server to run your "app".

Collapse
 
epranka profile image
Edvinas Pranka

Thanks, for this list. I just tried the Gatsby and Next.js. Maybe I will find my favorite :)

Collapse
 
diek profile image
diek

Talk me about your Next.js experience, please :)

Collapse
 
epranka profile image
Edvinas Pranka

This is my two production ready projects done with it:
GintautasRapalis.com
Gerlangas.lt. These projects are done with highly customized Next.js (App, and Document), because of routing transitions, data bindings and preloaders.
And I have some project in progress :)

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Sure :)

Collapse
 
sujaykundu777 profile image
Sujay Kundu • Edited

I use Jekyll for my blog ! Even I built a theme out of it for Developers who want to create a blog using it - Checkout here - devlopr-jekyll 😃

Collapse
 
maymeow profile image
Meow

Thank you for post.
My favorite for now is Hugo :)

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Same here :)

Collapse
 
diek profile image
diek

Ey Nirazan! Nice help is yours. Can you write next some little tutos of usage about the ones you think that they are in fact useful? Thank you!

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

I am thinking about writing HUGO tutorials :)

Collapse
 
louis profile image
Louis Augry

You can add Scully, an Angular static generator github.com/scullyio/scully

Collapse
 
nirazanbasnet profile image
⚡ Nirazan Basnet ⚡

Didn't know about that thanks for sharing :)

Collapse
 
timon profile image
Timon van Spronsen

There is also Zola which is written in Rust and is supposed to be really fast. I haven't used it yet, but I'm planning to use it for my next website.

Collapse
 
jonstodle profile image
Jon Stødle

+1 for Zola. Switched to it from Hugo, after Hugo stopped organizing my site correctly. Zola is super fast to compile and dead easy to use.

Collapse
 
shaijut profile image
Shaiju T • Edited

Nice 😄, After 5 months , Is Hugo is still best , Among all ?

Collapse
 
bayuangora profile image
Bayu Angora

Still fastest.

Collapse
 
abdurrahmaanj profile image
Abdur-Rahmaan Janhangeer

Pelican is a Python standard. I don't see it in here ^^_

Collapse
 
jwp profile image
John Peters

Is this a biased list against Angular?

 
esspetess profile image
Yih Sev

Great! Thank so much will definitely check out your templates. :D