Static website

More or less, I am used to LAMP (Linux, Apache, MySQL, PHP/Python) as a standard approach to make a website.

However, some of the sites does not get updated so often, and require little user interaction. In these cases, a simpler static website would do.

One way to thing about static website is that it just changes the timing of generating HTML. For dynamic site, HTML is generated from content when user access the page; meanwhile for static site, HTML is generated when content being added or changed.

A quick example is personal blog site. It usually get updated at most a few times a day. And the simplest user interaction would be “drop me an email” button.

There are already lots of projects for generating a static website. Among them the most popular one is Jekyll.

It is very easy to build and deploy a static website (e.g. on AWS). Steps:

  1. Install Jekyll.
  2. Choose a base directory. Make a _post directory and add some markdown documents in it.
  3. Optionally, find a ready-made Jekyll template and extract it to the base directory.
  4. Call ‘jekyll build’ to build the site. By default generated site is in _site directory.
  5. Install Apache, and configure it to serve site on the _site directory.

Done. No script, no database.

Since the site is static, you can host it on Amazon S3, without even starting an EC2 instance.

For automation, it is possible to use git hook to re-build the site when there is an update.

Any other kind of trigger would also work, like Dropbox or Email.

For interaction feature, it is also possible to use Disqus for comments.

This entry was posted in Web. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s