Over the past few years, static site generators have gone from being a bit of a novelty only the über-geeks used to prove the quality of their skill, to becoming widely used tools that power a large and growing part of the internet. Because of the benefits they offer, static site generators are now used to run thousands of sites and are becoming the basis for a broad set of tools that even reach the casual developer and even the nontechnical content writer.
Still, the static site ecosystem is still young and slightly immature, meaning that it can be difficult to know which tools to choose and how to get started. That is the problem we hoped to address in writing this book. By providing common scenarios and insights on how to address them, we hope to make it easier for anyone—from the experienced web expert to the beginning web developer—to create static site solutions and take advantage of the speed, flexibility, and security that they offer.
Is this book for you? The following items can help you determine that:
This book is for web developers who are looking for a simpler way to build and deploy websites. For developers with experience with dynamic app servers (like PHP, Node.js, and ColdFusion), this book will present a simpler alternative. For developers who are still working with simple websites but need a way to make them more powerful, this could be just the ticket to bringing your sites to the next level.
This book focuses on static site generators that work from the command line. Desktop tools that have similar features are not covered.
The book begins by describing why you would want to use static sites. Each subsequent chapter focuses on a specific type of site and uses this as a way of introducing different static site generators.
After discussing how to build a site, the book moves on to cover more advanced topics such as adding dynamic elements back in, working with a CMS, and how to deploy and host your static site.
The last chapter discusses how to migrate from a dynamic site to a static one.
The following typographical conventions are used in this book:
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
This element signifies a tip or suggestion.
This element signifies a general note.
This element indicates a warning or caution.
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/cfjedimaster/Static-Sites-Book.
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Working with Static Sites by Raymond Camden and Brian Rinaldi (O’Reilly). Copyright 2017 Raymond Camden and Brian Rinaldi, 978-1-491-96094-3.”
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at [email protected].
Safari (formerly Safari Books Online) is a membership-based training and reference platform for enterprise, government, educators, and individuals.
Members have access to thousands of books, training videos, Learning Paths, interactive tutorials, and curated playlists from over 250 publishers, including O’Reilly Media, Harvard Business Review, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, and Course Technology, among others.
For more information, please visit http://oreilly.com/safari.
Please address comments and questions concerning this book to the publisher:
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://www.oreilly.com/catalog/0636920051879.do.
To comment or ask technical questions about this book, send email to [email protected].
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
From Raymond Camden:
First and foremost—I thank my wife. Jeanne, you always believe in me and always support me. Thank you.
Second, thank you, Brian, for agreeing to write with me. While we may be mortal enemies, I’m happy we were able to put our differences aside for this endeavor! ;)
Lastly, thank you to everyone who reads, and participates, at my blog (raymondcamden.com). Your questions and comments keep me on my toes!
From Brian Rinaldi:
I’d like to thank my wife, Claudia, whose love and support makes me a better man.
I’d like to thank Ray for proposing this book in the first place and for constantly pushing me to actually finish it. Now that this is over, I will resume planning his destruction.