Skip to Content
Working with Static Sites
book

Working with Static Sites

by Raymond Camden, Brian Rinaldi
March 2017
Intermediate to advanced
198 pages
4h 16m
English
O'Reilly Media, Inc.
Content preview from Working with Static Sites

Chapter 5. Adding Dynamic Elements

Now  that you’ve made the decision to use a static site generator (woo!), you may discover that you’ve forgotten one little detail that seems to require a dynamic application server of some sort. Perhaps you have a contact form. Maybe you want to add discussions to your blog. Does this mean you’ve made a horrible mistake and have to revert everything you worked on? Of course not!

Multiple different services exist that enable you to add dynamic features back to your site. In some cases, it is nearly impossible for the end user to tell that anything “special” is being done at all. To them, it simply appears as if your site is doing whatever it needs to on the backend, when in reality you’re still using simple static files.

In this chapter, we’ll discuss how to add dynamic elements back in to your static site. We’ll focus on:

  • Forms
  • Comments
  • Search

We’ll also discuss some other options for data types, like events and generic sets of data.

Handling Forms

Since the dawn of the web itself, forms have been an integral part of how users interact with your site. Moving to a static site doesn’t make forms themselves magically stop working. They still render. You can still interact with them using JavaScript. But if you want the form to do something on a server or to communicate with someone else, then you’ll be out of a luck when using a static site. Luckily, a number of options exist for adding basic form processing to your site. Let’s ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Static Site Generators

Static Site Generators

Brian Rinaldi

Publisher Resources

ISBN: 9781491960936Errata Page