wordpress as a static site generator

30
WordPress as a Static Site Generator Leon Stafford

Upload: others

Post on 10-Jan-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WordPress as a Static Site Generator

WordPress as a Static Site Generator

Leon Stafford

Page 2: WordPress as a Static Site Generator

Leon Stafford36, BRISBANE

Sign: .AquariusPassions: Open source, automation, low resource computingTurn-offs: .Insecurities (with your hosting), slow pageloadsOccupation: ..Founder, developer, support engineer @ wp2static.comSeeking: .Businesses having commitment issues with WordPress

Page 3: WordPress as a Static Site Generator

What we'll be covering

● static websites

● wtf are they?

● eww, why would I want one?

● j/k, FOMO, how do I get one?

Page 4: WordPress as a Static Site Generator

What is a static site?static dynamic

Page 5: WordPress as a Static Site Generator

What is a static site?static dynamic

Page 6: WordPress as a Static Site Generator
Page 7: WordPress as a Static Site Generator

So, what's the difference?

● pre-generated

● low-resource

● usable offline

● secure by default

● compiled on the fly

● resource-intensive

● online only

● needs security

static dynamic

Page 8: WordPress as a Static Site Generator

Why would I want a static site?

secure fast low-cost

Page 9: WordPress as a Static Site Generator

Security

With no database, no PHP, there is very little attack vector left exposed

Page 10: WordPress as a Static Site Generator

Performance

No such thing as a cache-miss

Page 11: WordPress as a Static Site Generator

vs Caching

"Once a resource intensive operation is done, remember the outcome. The next time the same

operation is requested, you can just give the result instead of doing that operation again."

--@brendt_gd (stitcher.io)

Page 12: WordPress as a Static Site Generator

Cost effectiveness

Gratis

Netlify, GitHub/GitLab/BitBucket Pages, S3, Azure, GAE free tiers, Firebase, Neocities

Cheap

BunnyCDN, KeyCDN, OBSD Amsterdam, etc.

Page 13: WordPress as a Static Site Generator

Cost to the environment

$40/month of hosting has to be paid by someone, selling something else, commuting to work, etc

Let's not waste energy on WordPress hamsters

Page 14: WordPress as a Static Site Generator

Resilience

Activists / political refugees

Page 15: WordPress as a Static Site Generator

Backends with benefits

Optionally, commit whole site snapshots under version control

When the fan gets dirty, instantly rollback while figuring out what went wrong

Page 16: WordPress as a Static Site Generator

Website archival

Take a snapshot of a legacy client's site, keep hosting it for free (you're a good human!)

Forget about it - no WP updates, no application vulnerabilities

Page 17: WordPress as a Static Site Generator

How to publish statically?

● wget

● httrack

● SiteSucker

● WP plugins

● Shifter

● Strattic

● HardyPress

● JAMstack + WP

Page 18: WordPress as a Static Site Generator

The JAMstackJavaScript APIs Markup

Use WordPress as a data-source for a

static site generator like gatsby.js

Page 19: WordPress as a Static Site Generator

Purely static vs dynamic elements

● contact forms

● comments

● search

● e-commerce

● user accounts

Page 20: WordPress as a Static Site Generator

Static site generators

● gatsby.js

● Hugo

● VuePress

● Eleventy

● Jekyll

● Hyde

● Pelican

● Jigsaw

staticgen.com

Page 21: WordPress as a Static Site Generator

Why we're not all using SSGs

● WP powering large chunk of web

● Ease of collaboration

● Opinionated workflows

● Command line fear

● WP admins can live in the browser

Page 22: WordPress as a Static Site Generator

WordPress Static Site Generator

Page 23: WordPress as a Static Site Generator

Best of both worlds

● collaboration

● plugins

● community

● rapid development

● security

● performance

● cost savings

● portability

WordPress WP SSG

Page 24: WordPress as a Static Site Generator
Page 25: WordPress as a Static Site Generator
Page 26: WordPress as a Static Site Generator
Page 27: WordPress as a Static Site Generator
Page 28: WordPress as a Static Site Generator
Page 29: WordPress as a Static Site Generator

Optimisation addicts

http://mywordpresssite.com/wp-content/themes

/twentyseventeen/assets/images/header.jpg

/w/t/t/assets/images/header.jpg

Page 30: WordPress as a Static Site Generator

Help on your static journey

Leon is active in several communities around static sites and is a guest on the next Static Bits episode.

leonstafford.github.io