Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a static site generator?

After ditching Wordpress, I've been experimenting with Jekyll to create a blog. I chose it (over Ghost) to help learn the basics of web development while I blogged. Also, the free hosting on GitHub Pages is neat and free.

What exactly is a static site generator (like Jekyll), and why do they exist?

like image 734
Nitin Savant Avatar asked May 12 '15 03:05

Nitin Savant


Video Answer


2 Answers

From Build a Blog with Jekyll and GitHub Pages course on Treehouse:

A static-site generator takes a set of templates and raw text files, runs it through a converter and renderer, then generates a plain HTML website that's ready to publish on any web server.

Advantages:

  • Sites load fast since we're serving regular pages to the browser and don't need to talk to a database on each request.
  • Sites are more secure because there's no database or dynamic content that can be hacked.
  • Less maintenance involved. No database means no need to configure and maintain a database or content management system (CMS).
  • Free hosting on GitHub Pages
  • Use your own domain name

Course Link: https://teamtreehouse.com/library/build-a-blog-with-jekyll-and-github-pages

like image 156
Nitin Savant Avatar answered Nov 18 '22 17:11

Nitin Savant


A static site has 3 components:

  1. HTML files (or other content to serve via the web, like .txt files)
  2. referenced assets (js, images, css)
  3. a web server

There is no database from which data is retrieved, compared to something like wordpress where all of your posts and pages live in a database. There is no server-side scripting engine with which to process information and render content.

Static site generators exist to provide you with tools like templating, shared data, and custom tags to assist in the creation of the static HTML pages that your web server will be serving.

The benefits of a static site are:

  • Security. The web server is the only moving part.
  • Portability. The HTML files will render the same when served from your local machine as they will on the web.
  • Speed. When almost everything is cacheable, compressed, and doesn't require any data crunching, things load very fast.
like image 32
bwest Avatar answered Nov 18 '22 17:11

bwest