7 Reasons NOT to Use a Static Site Generator

By Craig Buckler
Mila is a prolific book cover designer on 99designs. Work with her today!
I'm led by "Work hard. Play fair. Be nice." That's a key to success.
Mila Milic

Static Site Generators

In my previous article we discussed reasons why you could benefit from using a static site generator. To recap:

  • A static site is a collection of pages contained in basic HTML files. You could hand-write these in a text editor, but managing assets and repeated elements such as navigation can become problematic.
  • A content management system (CMS) stores page content in a database and provides facilities to edit and apply themes. Management becomes easier at the expense of flexibility, performance, server requirements, security and backups.
  • A static site generator (SSG) is a compromise between using a hand-coded static site and a full CMS. You generate an HTML-only website using raw data (such as Markdown files) and templates. The resulting build is transferred to your live server.

static site generators

Popular static site generators include Jekyll, Pelican, Hugo and Metalsmith — see StaticGen for many more options.

SSGs appear to offer the benefits of both CMS and static worlds, but they will not be suitable for every project …

1. You’re On Your Own

You won’t get far using a static site generator without some development expertise. The process is more difficult than using a CMS, there are fewer reference resources, and you could struggle to find pre-built plugins and templates.

Contrast that with WordPress. A non-technical user may require installation assistance but, once done, they can edit a site and install one of the many thousands of themes and plugins available. They may not have the best bespoke website, but they’re running with minimal intervention.

2. Choice Paralysis

There are many static site generators, but even the most popular tools are used by a tiny proportion of the web community. You’ll need time to research, investigate and evaluate the options. The undisputed champion is Jekyll but, while you don’t necessarily require Ruby expertise, it will help if you’ve used the language before.

There are many CMSs, but there’s one obvious choice: WordPress. It powers more than one in every four websites, so help is abundant. Again, it will help if you have some PHP experience, but even a non-developer can create a reasonable website using off-the-shelf themes and plugins.

3. The Initial Setup Time

Creating your first static site will take time. You’ll need to learn the build process, and much of the template code will need to be developed. Deployment scripts may also be necessary.

Developing a custom CMS theme can also be complicated, but pre-built templates are available and assistance is easier to find. File deployment is rarely required following the initial installation.

4. No Administration Interface

Clients may be cautious when faced with a CMS interface. Asking them to create and edit a set of Markdown files may terrify many. You can make the process easier. For example:

  1. allow them to use their existing CMS, or
  2. provide simpler workflows such as editing Dropbox files in StackEdit.

But this will further impact your initial development time.

5. Website Consistency

Static sites are flexible: anything contained within source Markdown files can be rendered as page content. Users may be able to include scripts, widgets or numerous undesired items.

A CMS constrains the user, because content is normally bound to a database with specific fields. Control panels prompt the user so it’s obvious they must enter a title, body content, excerpt etc. Even if the user enters something in an unexpected field, it won’t appear on the website unless it’s implemented within the theme template.

6. Managing Large Sites

Consider a website with thousands of pages, regular publications, real-time breaking news and dozens of authors in multiple locations. SitePoint is a great example. It would be possible to manage content using a static site generator, but:

  • content editing and publishing is more awkward. Editors may require access to the Git repo or shared folders rather than a simple web or app interface.
  • real-time updates would be delayed because the site must be rebuilt, tested and deployed
  • build times could increase rapidly and deployment would become cumbersome.

Static site generators are perhaps best suited to sites containing no more than a few hundred pages with a couple of new posts every week. Automated build and deploy processes will be required, and you may reach a point where a CMS becomes a more practical option.

7. Sites with Server-side Functionality

A true static site cannot offer interactive facilities such as user logins, form filling, search or discussion forums. There are some client-side options such as lunr.js search and Disqus commenting, but your choices will be more limited.

There are solutions such as using a build step which generates a static site containing necessary <?php ... ?> code blocks. This should pre-render HTML where possible, e.g. navigation, includes, partials, etc. to ensure pages are more efficient and require less effort from the PHP processor. Unfortunately, you’re increasing the build complexity, and it may be of little benefit to some frameworks.

Is a Static Site Right For You?

Before making any decision, examine:

  • your project requirements, size, complexity, etc.
  • your userbase
  • your team’s development skills, and
  • the hosting and/or deployment factors.

The vast majority of websites rarely exceed a few dozen pages, receive infrequent updates and depend on a developer to make those changes. A CMS is often overkill, and static site generation could ease development and reduce costs. However, persuading your client to abandon their CMS administration panels could be a tougher task …

For a practical demonstration of how to build a site with a static site generator, see my How to Create a Static Site with Metalsmith article.

  • http://rafaelstz.github.io Rafael Corrêa Gomes ♛

    Really great, thank’s!

  • http://www.thecheesyanimation.com/3D-Architectural-Rendering.html Testino Delevingne

    One of the reasons listed was better security by having no code executed on the server. That argument falls apart if you’re willing to have some code running.

    • Craig Buckler

      That’s the compromise. A static site is more secure because no server code is executing. But you may need to forego that benefit if you absolutely require server-side processing.

  • mbokil

    A lot of the news sites switch from dynamic to static under a heavy load which limits features but still allows pages to be served. An interesting hybrid approach.

    • Craig Buckler

      Thanks mbokil – that’s a good point. Some sites also produce a few static pages for news or features experiencing heavy load. It’s a great idea but few site owners will have the resources to do it.

    • http://www.uunis.net/ Ion-Christopher

      OHHHhhhh! THAT’s wtf is going on…! I wonder if they could be a little more informative to keep my finger off the refresh key. Think that might help the server?

    • http://habd.as Josh Habdas

      Constraints breed creativity.

  • Craig Buckler

    Great stuff. I agree a static generator is suitable for the majority of sites. It should be the default choice unless many people are making daily updates.

  • Raivo Laanemets

    Do not forget to properly set up redirects for feeds when switching to static site. Static site generators often support feeds but existing readers won’t know about the new feed URL. HTML meta redirects and JavaScript-based redirects won’t work, you need a proper server-side redirect through htaccess file or similar technique. Or just create symlink that matches old feed URL to the new feed file.

  • Fahad Murtaza

    SSGs, that is a cute acronym for Static Site Generators, the other one I know is Special Services Group, the army unit.

  • http://exclusive-paper.com JanySmool

    Hello, thank you very much for this cool advice, i will try to use your tips! Also, I would like you know, what kinds of platform I can use of it! Thank you very much for your answer)

  • Nicholas Johnson

    So don’t use a static site generator if you or your client don’t know how to code, or if you need dynamic content like a forum.

    • http://habd.as Josh Habdas

      I think they call it SquareSpace.

      • https://blogantoniotrento.github.io Antonio Trento

        True Siteleaf make possibility to auto gen a static and host it but is expensive

    • Ralph Mason

      There are also tools like Siteleaf that provide the option to manage and present a static site to your clients.

  • Kael

    O disagree with everything in the article. As a developer I consider Hugo, Harp e Hexo and similar SSGs much more easier to understand than WordPress. How can ppl consider WordPress easy to *properly* manage? My clients are having a better time with markdown and the frontmatter than using wordpress web interface.

    • Craig Buckler

      The point I was making is that you can install WordPress, grab a theme, sprinkle on a few plugins and issue a login ID within minutes. That’s how some companies operate – they don’t write any code. That has to be easier!

      I would love it if all clients preferred markdown. In my experience, most prefer WYSIWYG even if they inevitably mess things up. In addition, they can visually manage the page hierarchy rather than moving or renaming files.

      However, I think you should read the previous article:
      I agree WordPress is overkill for the majority of websites.

  • treegb

    Take a look at Dokuwiki.

    Dokuwiki is a CMS wiki similar to Mediawiki or many other wiki platform, but the system is much more simple to setup, edit, query, backup.

    Dokuwiki is written with PHP so it is a dynamic website, but no database needed, Dokuwiki store data in plane text instead of database. This makes the data more “safe” and posible to read/modify outside of wiki if necessary.

    As a wiki platform, Dokuwiki use wiki markup, which is no different to SSG markup
    , but I’m not sure about insert the dynamic content in content in Dokuwiki, it can insert html tag in content but not sure if PHP works too.

    Dokuwiki have a plugin to convert whole site to static HTML site, this make no different as the efficiency or security aspect compare to SSG.

Get the latest in Front-end, once a week, for free.