No time to learn a static site generator? Try this
Tags: ssg, staticsitegenerator, website, staticsite
Published: 2021-09-30 16:01:56

---
title: No time to learn a static site generator? Try this
published: true
description: Static Site Generator alternative
tags: SSG, staticSiteGenerator, website, StaticSite
cover_image: https://res.cloudinary.com/randombyte/image/upload/v1633015654/photo-1611434132218-d687f8a5f378_x6dpxh.jpg
---

### What is a Static Site Generator(SSG)?

Traditionally we built sites supported by a backend that takes data and spreads it onto an HTML template.
 Backends also took care of the differences between rendered pages.
This setup is what we refer to as a dynamically rendered site.

For many sites, this approach meant each time a user visited the website, the backend did the same thing repeatedly. 
So the idea of a static site generator is to mix the data/content with the HTML templates once and then keep a copy of the output to be served to users.

 With this approach, you have a faster website. You also remove the overhead of maintaining the backend code in production, leaving you with a basic server setup to manage. 

You may also give up the server setup altogether to use any of the numerous static site hosting solutions out there.

### Challenges static site generators present to developers
<img src="https://res.cloudinary.com/randombyte/image/upload/v1633014848/business-man-pushing-large-stone-up-to-hill-business-heavy-tasks-and-picture-id825383494_gnphts.jpg" width="100%" height="29%"/>
<small>Credit: [Unsplash](https://www.istockphoto.com/photo/business-man-pushing-large-stone-up-to-hill-business-heavy-tasks-and-problems-concept-gm825383494-133865749)</small>

Do note that there are general cons to having static sites. I am not going to talk about those.
I am addressing the cons static site generators themselves present.
- They come with a learning curve, and it’s made worse given there are too many static site generators out there. This means you are likely to hop on a project using one you are not familiar with.
- Limited functionalities, developers are limited to what a static site generator provides. Do you want a specific date format? Your best bet is a plugin, and pray it exists.
- The authoring process is a nightmare for non-developers, from dealing with markdown files to sometimes dealing with build pipelines. It’s even becoming a requirement for hiring content creators in some cases.


### What’s the alternative?
<img src="https://res.cloudinary.com/randombyte/image/upload/v1633015519/carbon_lfiffb.png" width="100%" />

Just build your site in whatever framework you are comfortable with, Laravel, Express, whatever. 
Then use a tool like [`wget`](https://www.gnu.org/software/wget) or [HTTrack](https://www.httrack.com) to generate the static files.

You might benefit from using SSGs, but I think this approach remains a good starting point.

With this approach, you can build a complete website with a backend admin that anyone can use.
Also, it will be based on a web stack you are familiar with or that your team is already using. You can build out whatever feature set you will need as well.

The image above shows the exact command I run to generate my site, you can find the explanation of each parameter [here](https://explainshell.com/explain?cmd=wget+-mpEk+-nH++-P+output_folder+http%3A%2F%2F%3Clocalhost%3A8080).
For example, I am currently working on https://codingterms.com/, and it’s running as a laravel app locally.  I run `wget` when I am ready to publish.

As far as feature sets go, I have many of them. One example is my ability to create hyperlinks pointing to other pages. The system checks if the page exists before making them visible as links on the other page. This way, I don’t have to go through older articles to change links. 

I am using `wget` for my personal website https://eddymens.com as well.


Another approach is using a CMS then generate the static files for production. When dealing with plugins, you need to be aware that this might not translate well to static site land, which is a general characteristic of static sites anyway.

Also, this allows you to move away from static sites to dynamic sites in a snap because you already have a dynamic site on hand.

I am still on the lookout for the gotchas of this approach and will share more as I progress. 

Originally posted on [Eddymens Personal Site](https://www.eddymens.com/blog/no-time-to-learn-a-static-site-generator-try-this)