phil hawksworth - dynamic static site strategies

178
><\ {} st DYNAMIC STATIC SITE STRATEGIES DEVCONFU, MAY 2014

Upload: devconfu

Post on 13-May-2015

309 views

Category:

Technology


1 download

DESCRIPTION

Are we over-engineering? What is the real effort in developing, hosting and maintaining sites which have many moving parts? The cost of serving static sites has never been lower. And front-end development practices have never been richer. Couldn't we harness this better and make life simpler without dumbing down? In this talk we'll explore some unexpected capabilities And characteristics of ""static"" sites. We'll look at ways to use emerging tools and services to create robust, high performance sites which can be more dynamic than some of their heavier and more costly brothers and sisters. You'll find that you can build faster, smarter, and more dynamic sites than you expected, without the need for complex back-ends.

TRANSCRIPT

Page 1: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

DYNAMIC STATIC SITE STRATEGIESDEVCONFU, MAY 2014

Page 2: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

DYNAMIC STATIC SITE STRATEGIESDEVCONFU, MAY 2014

DYNAMIC STATIC SITE STRATEGIES

Page 3: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

STATIC SITEGENERATION

Page 4: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

SSGEEWIZZ

Page 5: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

SSGEEWIZZ

Page 6: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

A QUICK INTRO

Page 7: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

PHILHAWKSWORTH@

#DEVCONFU

Page 8: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CLIENTS

Page 9: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

FRONT END

Page 10: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

I’M A SOFTWARE ENGINEER

WHAT LANGUAGE?

JAVASCRIPT

HA HA HA HA...!

Page 11: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><F#@!!!

Page 12: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

TOOLSENGINEERING

o

Page 13: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><M

Page 14: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH>< M

HIPSTER

TAXthe

Page 15: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><STATIC SITEGENERATION

Page 16: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><THE GOOD OL’ DAYS

Page 17: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

~/htdocs

Page 19: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WRITE TEXTSAVE

REFRESHREPEATREJOICE

Page 20: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

MORE AMBITIOUS

Page 21: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

YOU NEED A SIEGEY BIN

MY BUDDY AT UNI

Page 22: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

cgi-bin

Page 23: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

PERL

Page 24: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

QPLUMBING & INFRASTRUCTURE

Page 25: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

A RETURN TO SIMPLICITY

Page 26: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

THE CHALLENGE

Page 27: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

THE {CLIENT} NEEDSA BEAUTIFUL SITECLEAR CONTENT

GOOD BROWSER SUPPORTSPEEDY LOADING

EASY TO UPDATEPROBABLY A CMSDYNAMIC CONTENT

SENSIBLE URLS

Page 28: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

A MOBILE FIRSTRESPONSIVE

WEB APP

BUZZWORD ALERT

k

k

Page 29: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AMOBILEFIRSTRESPONSIVEWEBAPP#

Page 30: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

A WEB SITE

Page 31: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

THE {CLIENT} NEEDSA BEAUTIFUL SITECLEAR CONTENT

GOOD BROWSER SUPPORTSPEEDY LOADING

EASY TO UPDATEPROBABLY A CMSDYNAMIC CONTENT

SENSIBLE URLS

Page 32: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

IS THIS ONLY POSSIBLE WITH A DYNAMIC

SERVER ARCHITECTURE?

Page 33: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

NO

Page 34: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

STATIC ARCHITECTURE

DYNAMICFEATURES

for

Page 35: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WHAT DOESDYNAMIC MEAN?

Page 36: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

PERSONALISED CONTENT

Page 37: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

USER GENERATED CONTENT

Page 38: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

TIME TO REFRESH

Page 39: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

{PUBLISHto

TIME

Page 40: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

KEEP IT FRESH

Page 41: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CODE

DEPLOYMENTCONTENT

DEPLOYMENT

Page 42: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

THE OPPORTUNITY

Page 43: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CONSIDERHONEST

USE CASES

Page 44: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

MANY TYPES OF SITES

Page 45: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

TARGETED CONTENT

Page 46: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

READ ONLY

Page 47: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

READ OFTEN

Page 48: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WE CAN MAKE EVERYTHING

FASTER

Page 49: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GROUND BREAKINGNEW APPROACH

62002

Page 50: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BAKE, DON’T FRY

Page 51: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

BAKE, DON’T FRYAARON SWARTZ

Page 52: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WEBMAKEA PERL CMS

Page 53: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

Page 54: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

I CARE ABOUT NOT HAVING TO MAINTAIN CRANKY AOLSERVER,

POSTGRES AND ORACLE INSTALLSAARON SWARTZ, 2002

Page 55: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

REDUCE COMPLEXITY

Page 56: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

EASE OF DEVELOPEMENT

Page 57: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

INCREASED PORTABILITY

Page 58: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

Page 59: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

Page 60: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CONFIDENCE

Page 61: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

ENTERPRISE COMPLIANCE

Page 62: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SECURITY AUDITPENETRATION TESTINGLOAD TESTING

Page 63: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

NOT ABOUT PERFORMANCE

Page 64: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SOME CHEAP PERFORMANCE GAINS EXIST

but

Page 65: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

FILE BASED ARCHITECTURE

Page 66: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

RAPID REQUEST

RESPONSE

Page 67: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

COSTS

Page 68: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

HOSTING

Page 69: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

“JUST A FEW PERSONAL SITES”

Page 70: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

NOW I’M SAVING$40 A MONTH

Page 71: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AT SCALE, THIS CAN BE

BIG

Page 72: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

MAINTENANCE

Page 73: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

LESS INFRASTRUCTUREFEWER SERVERSLESS PRODUCTION CODE

Page 74: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

PORTABILITY

Page 75: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

FILES CAN GO ANYWHERE

Page 76: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AVAILABILITY OF SKILLS

Page 77: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

FOCUS

Page 78: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

ARCHITECTURAL COMPLEXITY

Page 79: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WIDERTALENT POOL

Page 80: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

DEVELOPMENT COSTS

Page 81: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CONFIDENCE

Page 82: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

TOOLS & ENABLERS

Page 83: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

EASIERITERATION

DYNAMICthrough

Page 84: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GENERATORSAUTOMATION HOSTING

Page 85: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

JEKYLL RUBY

HYDE PYTHON

MIDDLEMAN RUBY

DOCPAD JAVASCRIPT

ASSEMBLE JAVASCRIPT

HARP JAVASCRIPT

Page 86: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

STATICSITEGENERATORS.NETDOCPAD / AUTOMATED / 274 SSGs

Page 87: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

274

Page 88: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH>< M

HIPSTER

TAXthe

Page 89: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

JEKYLL

Page 90: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

{}\

{}\

Page 91: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

BIG STACK

TINYSTACK

SMALL STACK

Page 92: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

The one problem with the “bake” philosophy is dependencies.

It’s difficult to keep track of which pages depend on which others and regenerate

them correctly when they change.

Page 93: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

The one problem with the “bake” philosophy is dependencies.

It’s difficult to keep track of which pages depend on which others and regenerate

them correctly when they change.

SOLVED

Page 94: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

RICH TEMPLATING ENGINESPARTIALSINHERITANCELOGIC

Page 98: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

DEPENDENCIES

Page 99: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

ATWOOD’S LAW

Page 100: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

ATTWOOD’S LAWANY APPLICATION THAT CAN BE WRITTEN IN JAVASCRIPT,

WILL EVENTUALLY BE WRITTEN IN JAVASCRIPT

JEFF ATWOOD, 2007

Page 101: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

$ npm install

Page 102: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

$ npm isntall

Page 103: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

BIG STACK

TINYSTACK

SMALL STACK

Page 104: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

BIG STACK

TINYSTACK

SMALL STACK

Page 105: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

HARPJS

Page 106: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

HARPJS PREPROCESSINGEJS, SWIGSASS, LESSCOFFEESCRIPT

Page 107: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

LESSBLOGGY

MOARDATA

OBJECTS

Page 108: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

RAPID & POWERFULSITE GENERATION

Page 109: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

RAPID & POWERFULSITE GENERATIONSOLVED

Page 110: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GENERATORSAUTOMATION HOSTING

Page 111: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

333

\\

Page 112: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

d

Page 113: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AUTOMATIONREPEATABLE

PREDICATABLELOW FRICTION

Page 114: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

FABRIC

Page 115: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GRUNTGULP

BRUNCHBELCHBURP

COUGHHICCUP

MMM

Page 116: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GENERATORSAUTOMATION HOSTING

Page 117: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SITE44

Page 118: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

333

\\

Page 119: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GITHUB PAGES

Page 120: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BITBALLOON

Page 121: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BITBALLOON

Page 122: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

HOSTING & OPTIMISATION AS A SERVICEAUTOMATIC CDN MANAGEMENTAUTOMATED DEPLOYMENTSOTHER FUNKY SHIZZLE

BITBALLOON

Page 123: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AMAZON S3GITHUB PAGES

DROPBOXSTATIC HOSTING AAS

ANY WEBSERVER

Page 124: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

PUSH IT

Page 125: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

EXAMPLES

Page 126: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

BEERCLUBSIMPLEST EXAMPLESIMPLEST WORKFLOWPOWERED BY NERDS

Page 127: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

OUTSOURCED HOSTING

Page 128: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GITHUB PAGES

Page 129: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

$ git push origin gh-pages

Page 130: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

OUTSOURCED VERSION CONTROL

Page 131: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

OUTSOURCEDSITE GENERATION

Page 132: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

OUTSOURCED DEPLOYMENT

Page 133: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><{{ site.data.FILENAME }}

Page 134: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><{{ site.data.drops }}

Page 135: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

Page 136: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

TOTALLYFORKEDSIMPLEST EXAMPLESIMPLEST WORKFLOWNOT POWERED BY NERDS

Page 137: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SIMPLIFYINGDUMBING DOWN

is not

Page 138: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SIMPLIFYINGFOCUS ON WHAT

lets us

MATTERS

Page 139: Phil Hawksworth - Dynamic Static Site Strategies

GOOGLE

Page 140: Phil Hawksworth - Dynamic Static Site Strategies

Developers Relations

Page 141: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><developers.google.com/web/fundamentals

Page 142: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

github.com/Google/WebFundamentals

Page 143: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SIMPLIFYINGFOCUS ON WHAT

lets us

MATTERS

Page 144: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

LIMITATIONS & WORKAROUNDS

Page 145: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SEARCH & COMMENTS

Page 146: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SEARCH

Page 147: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SIMPLE INDEXJAVASCRIPTPROGRESSIVE ENHANCEMENT

A JEKYLL EXAMPLE

Page 148: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

A SIMPLE BLOG SITE

Page 149: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><{ "posts" : [ {% for item in site.posts %} { "title" : "{{ item.title }}", "url" : "{{ item.url }}", "date" : "{{ item.date | date_to_long_string }}", "words" : "{{ item.content | strip_html | wordmap }}" } {% if forloop.last != true %},{% endif %} {% endfor %}]}

SRC/SEARCH.JSON

Page 150: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><{! "posts" : [! {! ! "title" : "TF;DR - Too funky; Didn't read.",! ! "url" : "/blog/too-funky-didnt-read",! ! "date" : "06 January 2014",

!"words" : "observations web excess trend for 'parallax''scrolljacking' sites has long had me grumbling about their large page weight slow rendering times general accessibility black spots but some are better than others that got thinking do they ever good job? today saw an article from creative bloq heralding recent example these kind as quirky masterpiece start by commenting: parallax scrolling may be way to becoming design cliche er yep somewhat! actually looks at technical approaches shoorder keep down just 77mb (big low typical single site) rest quote hits home though: agencies putting imaginative aesthetically pleasing uses there's surely life old dog yet this reminds one reasons wanted join big agency like r/ga first place - add voice those fighting responsible executions which often have audiences sometimes (or least propagate) development trends we need mindful type build best solution? most responsible? was see were making efforts bring you sound broken record phil not going embark my usual rants bloated pages require loading screens gobble your mobile data allowance because i've done so many before went look site referring noticed something: didn't read really even notice any content might squinting through judgmental eyes purist don't think reality style rarely choice conveying perhaps when people encounter all kinds whizzy interaction baubles play with ahead reading apparently cadillac know said otherwise afraid detail passed question out there: did what you've seen recently said? curious hear regardless implementation performance how examples getting message across observations? reply tweet twitter photo credit: david san"

! }, ...

SITE/SEARCH.JSON

Page 151: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

INLINE JAVASCRIPT SEARCH

Page 152: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

LOAD ASYNCHRONOUSLY AFTER PAGECACHED AND STATICCONTEXTUAL LOAD

PAGE WEIGHT?

Page 153: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

CONTEXTUAL LOADING

Page 154: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

JAVASCRIPTONLY?

Page 155: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

PROGRESSIVE ENHANCEMENT

Page 156: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><SRC/SEARCH/INDEX.HTML

<form action="https://www.google.co.uk/search” method="get" class="search">

<input type="hidden" name="q" value="site:http://hawksworx.com/blog">

<input type="text" name="q">

<input type="submit" class="submit" value="Search with Google">

</form>

Page 157: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

JSBIN.COM/HELP

Page 158: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><COMMENTS

Page 159: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

WHAT ABOUT COMMENTS?

FIRST!

DAMMIT I THOUGHT I WAS FIRST BUT U BEAT ME LOL ROFL OMG WTF HA HA!!!!!!!!!

Page 160: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

HOW TIMELY SHOULD

COMMENTS BE?

REAL TIMEOR

MODERATED?

Page 161: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

COMMENTAPPROVALWORKFLOW

Page 162: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BITBALLOON

Page 163: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BITBALLOON

Page 164: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

OTHERFUNKYSHIZZLE

BITBALLOON

Page 165: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

BITBALLOON API

Page 166: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

AUTOMATICFORM HANDLING

Page 167: Phil Hawksworth - Dynamic Static Site Strategies

><\ {}st

@PHILHAWKSWORTH><<form name="signup" action="thank-you.html"> First Name: <input type="text" name="first_name"> Email: <input type="email" name="email"> <button>Sign me up</button></form>

Page 168: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

DATA HANDLINGAPI ENDPOINTEMAIL NOTIFICATIONSINTEGRATIONS WITH OTHER SERVICES

Page 169: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

Page 170: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

GET DATA

BUILDas part of the

Page 171: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CALL TO ARMS

Page 172: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SEEK OUT CHANCES TO

SIMPLIFY

Page 173: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

CHALLENGE THE NEED FOR COMPLEXITY

Page 174: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

MAKE STUFF FASTER

Page 175: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

MAKE STUFFGO FASTER

Page 176: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu

@PHILHAWKSWORTH

SPEND LESS

Page 177: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

THANKS

FONTS

LINKS

BATTLESHIP - www.flickr.com/photos/swfphotos/8075999488COMPLIANCE - www.flickr.com/photos/aorr/1229272894SALTNPEPPER - www.flickr.com/photos/camknows/4595655917FRESH PRINCE - flic.kr/p/fJcbnCAMBITIOUS - flic.kr/p/6Uvc2S

JEKYLL - jekyllrb.comHARP - harpjs.com, harp.ioSSGS - staticsitegenerators.netHEXO - zespia.tw/hexoBAKE, DON’T FRY - www.aaronsw.com/weblog/000404BITBALLOON - www.bitballoon.comBITBALLOON API - github.com/BitBalloon/bitballoon-apiGOOGLE WEB FUNDAMENTALS - developers.google.com/web/fundamentals

PLACARD CONDENSEDVENEER EXTRASWC RHESUS BETAMAC ICON STANDARD

Page 178: Phil Hawksworth - Dynamic Static Site Strategies

><{}\ stu{}\

THANKS!PHILHAWKSWORTH@