working_with_staticsites.pdf

(30709 KB) Pobierz
Working with
Static Sites
BRINGING THE POWER OF SIMPLICITY
TO MODERN SITES
Raymond Camden
& Brian Rinaldi
Bringing the Power of Simplicity to Modern Sites
Working with Static Sites
Raymond Camden and Brian Rinaldi
Beijing
Boston Farnham Sebastopol
Tokyo
Working with Static Sites
by Raymond Camden and Brian Rinaldi
Copyright © 2017 Raymond Camden and Brian Rinaldi. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/insti‐
tutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editor:
Allyson MacDonald
Production Editor:
Shiny Kalapurakkel
Copyeditor:
Gillian McGarvey
Proofreader:
Susan Moritz
March 2017:
First Edition
Indexer:
Wendy Catalano
Interior Designer:
David Futato
Cover Designer:
Karen Montgomery
Illustrator:
Rebecca Demarest
Revision History for the First Edition
2017-02-28:
First Release
See
http://oreilly.com/catalog/errata.csp?isbn=9781491960943
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Working with Static Sites, the cover
image, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-96094-3
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
1.
Why Static Sites?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Benefits of Static Sites
Static Sites Are Fast
Static Sites Are Secure
Other Benefits
What Kinds of Sites Can Go Static?
What Are Static Site Generators?
Welcome to Harp
Your First Harp Project
Working with Layouts and Partials
Working with Data
Generating a Site
Building Camden Grounds
Going Further with Harp
2
2
2
3
3
4
2.
Building a Basic Static Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
10
12
16
19
25
25
37
39
41
45
48
50
52
54
57
iii
3.
Building a Blog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Blogging with Jekyll
Your First Jekyll Project
Writing a Post
A Quick Introduction to Liquid
Working with Layouts and Includes
Adding Additional Files
Working with Data
Configuring Your Jekyll Site
Zgłoś jeśli naruszono regulamin