SlideShare a Scribd company logo
…there was a time before
WordPress
One file per page
Assemble pages by including
common components
Mix in data from other sources
Emerging trends
• DRY
• Eliminate duplicate content
• Separate concerns
• Improve productivity
Thanks PHP
They matter too
But what about the content authors?
Content is a first class citizen
Further separation of concerns
• Users enter content using a GUI
• Programmers create templates that utilize the user-entered content
• Web pages generated on demand
Sounds simple?
It’s not
• With (pretty much) any CMS:
• Wrangling together templates and data is complicated
• The process is demanding and involves needless work
Most CMS-based websites
Writes ReadsExpensiveModerate
Some CMS-based websites
Writes ReadsCheapModerate
Thanks caching!
“The stack” stacks up
HTTP Accelerator (Varnish)
Web Server (Apache)
Application Server (WordPress/PHP)
Database (MySQL)
Object Cache
(MemCached)
File System
Too far?
Do you build a solution for your
problem or do you fit your problem
into a solution?
Build a solution
• We have the tools:
• Static site generators
• Rapid application frameworks
• APIs
• CMSs / Writing rooms
Big problems
Tiny solutions
Why static sites
• Fast
• Secure
• Scalable
• Simple themes and integrations
• Own conventions, languages, and tools
• Excellent version control story
The generators help!
Build
HTML
JS SVGCSS
GIF JPGPNG
Source
HTML
COFFEE SVG
TWIG ERB
SCSS
GIF JPGPNG
JSON YAML MD
Productivity, performance, security, scalability 

paid for with slow resource intensive build
processes
The new reality
Writes ReadsCheapExpensive
Requirements diminish
Server/CDN
File System
More hosting options open up
• Shared hosting
• VPS
• GitHub Pages (https://pages.github.com/)
• Dropbox (https://pages.github.com/)
• Google Drive (https://www.google.com/drive/)
• Amazon S3 (http://aws.amazon.com/s3/)
There are drawbacks
• Particularly with the concept of keeping content in flat files
• Hard to contribute (knowledge of Git)
• Hard to collaborate
Writing rooms to the rescue
• Contentful (https://www.contentful.com/)
• Prismic.io (https://www.prismic.io/)
• Pull in data through the API into a static build process
Focus
Admin interface for content creation and
collaboration
However…
• Subscription services
• Potential for vendor lock-in
• Lack of mature, open source alternatives
WordPress as a pure CMS
• WordPress can be used as an alternative to writing rooms like
Prismic.io and Contentful
• Content authors use WordPress to manage content and collaborate;
not to build web sites
• Content pulled out of WordPress and injected into static build
process
WP REST API
• Popular plugin that will be integrated into core
• Provides an HTTP REST API
• Extensive API for CRUD operations on comments, media, meta data,
posts, taxonomies, and users
• http://wp-api.org
Advanced Custom Fields Pro
• Popular plugin that allows for rapid creation of custom fields
• Supports many field types, including text, number, image, map,
links, and post references
• Rich ecosystem of extensions including repeaters
• http://www.advancedcustomfields.com
WP REST API Custom Fields
• Adds custom fields defined with ACF Pro to JSON output
• Inserts an object into the meta key with all your fields
• http://wordpress.org/plugins/wp-rest-api-custom-fields
Putting the backend together
• A 15-minute REST server with multi-user support, roles and
permissions, and an admin interface
1. Enable the aforementioned plugins
2. Setup friendly permalinks
3. Create custom post types if necessary
4. Setup custom fields if necessary
5. API accessible at /wp-json
Choosing a static site generator
• Comes in pretty much any language: C, C++, Java, Go, Haskell,
Erlang, JavaScript, Ruby, Python, PHP, etc.
• Choose a language you a comfortable with and enjoy working with
• Choose a system that is mature
• Choose a system that lets you work with many different types of
inputs, including remote content for maximum flexibility
Middleman
Hand-crafted frontend development

https://middlemanapp.com/
Key Features
• HTML, Markdown, YAML, and JSON format
• Templating language
• Asset pipeline
• Live reload
• Development server
• Common preprocessors and concat/minify out of the box
Useful Extensions
• Deploy
• Blog
• Pagination
• SVG Fallback
• Full list: https://directory.middlemanapp.com/#/extensions/all
Directory Structure
• Data
• Lib
• Source
• Images
• Javascripts
• Layouts
• Stylesheets
• Pages, posts, etc
Source
index.html.md
/about
Build
Data
/css /js/img
layout.html.erb logo.svg all.scss
_header.scss
_footer.scss
all.js
menu.coffee
feed.js
_header.html.erb
/layouts
Build
index.html
/about /css /js/img
logo.svg all.css all.js
logo.png
logo@2x.png
Dynamic Files
• Data is made available to our templates
• Useful for creating menus, lists, directories, etc.
• Pages can also be dynamically generated from data
sally.html roger.html sue.html
steven.html lisa.html
people
build
people.json
data
Dynamic Pages
In config.rb
people.each do |person|
proxy “people/#{person[‘name’]}.html”,
“layout/person.html”, locals: { person: person }
end
Data Source Library
In lib/wordpress.rb
class WordPress
include HTTParty
def initialize(uri)
self.class.base_uri uri
end
def posts
@posts ||= self.class.get(‘/posts?type=post’)
end
end
Dynamic Pages from Data Source
In config.rb
@wordpress = WordPress.new(“http://supersecret.dev/wp-json”)
@wordpress.posts.each do |post|
proxy “/blog/#{post[‘slug’]}/index.html”, “templates/post.html”,
locals: { post: post }
end
Expose Data Source to Templates
In config.rb
helpers do
def wordpress
@wordpress
end
end
Use Data Source in Templates
In source/blog/index.html
<% wordpress.posts.each do |post| %>
<div>
<h3><a href=“/blog/<%= post[‘slug’] %>/”><%= post[‘title’] %></a></h3>
<div><%= post[‘excerpt’] %></div>
</div>
<% end %>
Nicer than this!
<?php

if (have_posts()) {

while ( have_posts()) { 

the_post();

?>

<div>

<h3><a href=“<?php the_permalink(); ?>”><?php the_title(); ?></a></h3>

<div><?php the_excerpt(); ?></div>

</div>

<?php 

}

}

?>
There’s a plugin for that
• Hookpress
• Turns internal hooks into web hooks
• Recompile your site when content is updated
• https://wordpress.org/plugins/hookpress/
Middleman-WordPress Example
https://github.com/knicklabs/middleman-
wordpress-example
High Voltage - Building Static Sites With Wordpress-Managed Content

More Related Content

What's hot

Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
asim78
 
Web browsers and web document
Web browsers and web documentWeb browsers and web document
Web browsers and web document
Mohammad Kamrul Hasan
 
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
Sonja Madsen
 
Basic Website 101
Basic Website 101Basic Website 101
Basic Website 101
Thomas Salmen
 
EDS selection & implementation @ CCC
EDS selection & implementation @ CCCEDS selection & implementation @ CCC
EDS selection & implementation @ CCCMolly Beestrum
 
Overview of Coding Languages
Overview of Coding LanguagesOverview of Coding Languages
Overview of Coding Languages
GlowTouch
 
Showcasing drupal
Showcasing drupalShowcasing drupal
Showcasing drupalOpevel
 
Static web documents
Static web documents Static web documents
Static web documents
bhashwitha kolluri
 
Did wordpressdothat
Did wordpressdothatDid wordpressdothat
Did wordpressdothat
Jon Bishop
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
Automate capabilities
Automate capabilitiesAutomate capabilities
Automate capabilities
Daniele Fittabile
 
Single page application
Single page applicationSingle page application
Single page application
Ismaeel Enjreny
 
dmBridge & dmMonocle
dmBridge & dmMonocledmBridge & dmMonocle
dmBridge & dmMonocle
University of Nevada, Las Vegas
 
WordPress Code Architecture
WordPress Code ArchitectureWordPress Code Architecture
WordPress Code Architecture
Mario Peshev
 
Drupal at the EBI
Drupal at the EBIDrupal at the EBI
Drupal at the EBI
Francis Rowland
 
sell idea
sell ideasell idea
sell idea
Rashmi Joshi
 
presentation on static website design
presentation on static website designpresentation on static website design
presentation on static website design
jyotiyadav1926
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
altsav
 
VFP & Ajax
VFP & AjaxVFP & Ajax
VFP & Ajax
Mike Feltman
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
Isuru Madusanka
 

What's hot (20)

Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
 
Web browsers and web document
Web browsers and web documentWeb browsers and web document
Web browsers and web document
 
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
 
Basic Website 101
Basic Website 101Basic Website 101
Basic Website 101
 
EDS selection & implementation @ CCC
EDS selection & implementation @ CCCEDS selection & implementation @ CCC
EDS selection & implementation @ CCC
 
Overview of Coding Languages
Overview of Coding LanguagesOverview of Coding Languages
Overview of Coding Languages
 
Showcasing drupal
Showcasing drupalShowcasing drupal
Showcasing drupal
 
Static web documents
Static web documents Static web documents
Static web documents
 
Did wordpressdothat
Did wordpressdothatDid wordpressdothat
Did wordpressdothat
 
High performance website
High performance websiteHigh performance website
High performance website
 
Automate capabilities
Automate capabilitiesAutomate capabilities
Automate capabilities
 
Single page application
Single page applicationSingle page application
Single page application
 
dmBridge & dmMonocle
dmBridge & dmMonocledmBridge & dmMonocle
dmBridge & dmMonocle
 
WordPress Code Architecture
WordPress Code ArchitectureWordPress Code Architecture
WordPress Code Architecture
 
Drupal at the EBI
Drupal at the EBIDrupal at the EBI
Drupal at the EBI
 
sell idea
sell ideasell idea
sell idea
 
presentation on static website design
presentation on static website designpresentation on static website design
presentation on static website design
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
VFP & Ajax
VFP & AjaxVFP & Ajax
VFP & Ajax
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 

Viewers also liked

Is Any Job Better Than No Job?
Is Any Job Better Than No Job?Is Any Job Better Than No Job?
Is Any Job Better Than No Job?
T & A Solutions
 
Why nosql also_why_somany
Why nosql also_why_somanyWhy nosql also_why_somany
Why nosql also_why_somany
Prashanth Panduranga
 
Being there
Being thereBeing there
Doc byyou
Doc byyouDoc byyou
Qualities To Look For In A Recruitment Agency
Qualities To Look For In A Recruitment AgencyQualities To Look For In A Recruitment Agency
Qualities To Look For In A Recruitment Agency
T & A Solutions
 
Introduction to Enterprise architecture and the steps to perform an Enterpris...
Introduction to Enterprise architecture and the steps to perform an Enterpris...Introduction to Enterprise architecture and the steps to perform an Enterpris...
Introduction to Enterprise architecture and the steps to perform an Enterpris...
Prashanth Panduranga
 
Maths probability
Maths probabilityMaths probability
Maths probability
Saurabh Sonwalkar
 
Factors to Consider Before Switching Your Job
Factors to Consider Before Switching Your JobFactors to Consider Before Switching Your Job
Factors to Consider Before Switching Your Job
T & A Solutions
 
Things To Avoid At Office
Things To Avoid At OfficeThings To Avoid At Office
Things To Avoid At Office
T & A Solutions
 
Minerals
MineralsMinerals
What's Your Element? - Ignite Presentation
What's Your Element? - Ignite PresentationWhat's Your Element? - Ignite Presentation
What's Your Element? - Ignite Presentation
maevekaiser
 

Viewers also liked (11)

Is Any Job Better Than No Job?
Is Any Job Better Than No Job?Is Any Job Better Than No Job?
Is Any Job Better Than No Job?
 
Why nosql also_why_somany
Why nosql also_why_somanyWhy nosql also_why_somany
Why nosql also_why_somany
 
Being there
Being thereBeing there
Being there
 
Doc byyou
Doc byyouDoc byyou
Doc byyou
 
Qualities To Look For In A Recruitment Agency
Qualities To Look For In A Recruitment AgencyQualities To Look For In A Recruitment Agency
Qualities To Look For In A Recruitment Agency
 
Introduction to Enterprise architecture and the steps to perform an Enterpris...
Introduction to Enterprise architecture and the steps to perform an Enterpris...Introduction to Enterprise architecture and the steps to perform an Enterpris...
Introduction to Enterprise architecture and the steps to perform an Enterpris...
 
Maths probability
Maths probabilityMaths probability
Maths probability
 
Factors to Consider Before Switching Your Job
Factors to Consider Before Switching Your JobFactors to Consider Before Switching Your Job
Factors to Consider Before Switching Your Job
 
Things To Avoid At Office
Things To Avoid At OfficeThings To Avoid At Office
Things To Avoid At Office
 
Minerals
MineralsMinerals
Minerals
 
What's Your Element? - Ignite Presentation
What's Your Element? - Ignite PresentationWhat's Your Element? - Ignite Presentation
What's Your Element? - Ignite Presentation
 

Similar to High Voltage - Building Static Sites With Wordpress-Managed Content

Geek basics
Geek basicsGeek basics
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
Dave Wallace
 
Wordpress intro
Wordpress introWordpress intro
Wordpress intro
the-colab
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
Jeff Fox
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
Talbott Crowell
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_phpJeanho Chu
 
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClassECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
European Collaboration Summit
 
Tech talk php_cms
Tech talk php_cmsTech talk php_cms
Tech talk php_cms
Shehrevar Davierwala
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar litbbsr
 
Web programming
Web programmingWeb programming
Web programming
Ishucs
 
Apache Content Technologies
Apache Content TechnologiesApache Content Technologies
Apache Content Technologies
gagravarr
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_phpJeanho Chu
 
Content Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentContent Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentDave Wallace
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
FITC
 
Drupal and Apache Stanbol
Drupal and Apache StanbolDrupal and Apache Stanbol
Drupal and Apache Stanbol
Alkuvoima
 
BITM3730 11-8.pptx
BITM3730 11-8.pptxBITM3730 11-8.pptx
BITM3730 11-8.pptx
MattMarino13
 

Similar to High Voltage - Building Static Sites With Wordpress-Managed Content (20)

Geek basics
Geek basicsGeek basics
Geek basics
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
Wordpress intro
Wordpress introWordpress intro
Wordpress intro
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClassECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
ECS19 - Vesa Juvonen - SharePoint and Office 365 Development PowerClass
 
Tech talk php_cms
Tech talk php_cmsTech talk php_cms
Tech talk php_cms
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Web programming
Web programmingWeb programming
Web programming
 
Apache Content Technologies
Apache Content TechnologiesApache Content Technologies
Apache Content Technologies
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 
Content Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentContent Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme development
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
Drupal and Apache Stanbol
Drupal and Apache StanbolDrupal and Apache Stanbol
Drupal and Apache Stanbol
 
Emkane RCC wp qs
Emkane RCC wp qsEmkane RCC wp qs
Emkane RCC wp qs
 
BITM3730 11-8.pptx
BITM3730 11-8.pptxBITM3730 11-8.pptx
BITM3730 11-8.pptx
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

High Voltage - Building Static Sites With Wordpress-Managed Content

  • 1.
  • 2.
  • 3. …there was a time before WordPress
  • 5. Assemble pages by including common components
  • 6. Mix in data from other sources
  • 7. Emerging trends • DRY • Eliminate duplicate content • Separate concerns • Improve productivity
  • 9. They matter too But what about the content authors?
  • 10.
  • 11. Content is a first class citizen
  • 12. Further separation of concerns • Users enter content using a GUI • Programmers create templates that utilize the user-entered content • Web pages generated on demand
  • 14. It’s not • With (pretty much) any CMS: • Wrangling together templates and data is complicated • The process is demanding and involves needless work
  • 15.
  • 16. Most CMS-based websites Writes ReadsExpensiveModerate
  • 17.
  • 18. Some CMS-based websites Writes ReadsCheapModerate
  • 20. “The stack” stacks up HTTP Accelerator (Varnish) Web Server (Apache) Application Server (WordPress/PHP) Database (MySQL) Object Cache (MemCached) File System
  • 21.
  • 23. Do you build a solution for your problem or do you fit your problem into a solution?
  • 24. Build a solution • We have the tools: • Static site generators • Rapid application frameworks • APIs • CMSs / Writing rooms
  • 26.
  • 27. Why static sites • Fast • Secure • Scalable • Simple themes and integrations • Own conventions, languages, and tools • Excellent version control story
  • 28. The generators help! Build HTML JS SVGCSS GIF JPGPNG Source HTML COFFEE SVG TWIG ERB SCSS GIF JPGPNG JSON YAML MD
  • 29. Productivity, performance, security, scalability 
 paid for with slow resource intensive build processes
  • 30. The new reality Writes ReadsCheapExpensive
  • 32. More hosting options open up • Shared hosting • VPS • GitHub Pages (https://pages.github.com/) • Dropbox (https://pages.github.com/) • Google Drive (https://www.google.com/drive/) • Amazon S3 (http://aws.amazon.com/s3/)
  • 33. There are drawbacks • Particularly with the concept of keeping content in flat files • Hard to contribute (knowledge of Git) • Hard to collaborate
  • 34. Writing rooms to the rescue • Contentful (https://www.contentful.com/) • Prismic.io (https://www.prismic.io/) • Pull in data through the API into a static build process
  • 35. Focus Admin interface for content creation and collaboration
  • 36. However… • Subscription services • Potential for vendor lock-in • Lack of mature, open source alternatives
  • 37. WordPress as a pure CMS • WordPress can be used as an alternative to writing rooms like Prismic.io and Contentful • Content authors use WordPress to manage content and collaborate; not to build web sites • Content pulled out of WordPress and injected into static build process
  • 38. WP REST API • Popular plugin that will be integrated into core • Provides an HTTP REST API • Extensive API for CRUD operations on comments, media, meta data, posts, taxonomies, and users • http://wp-api.org
  • 39. Advanced Custom Fields Pro • Popular plugin that allows for rapid creation of custom fields • Supports many field types, including text, number, image, map, links, and post references • Rich ecosystem of extensions including repeaters • http://www.advancedcustomfields.com
  • 40. WP REST API Custom Fields • Adds custom fields defined with ACF Pro to JSON output • Inserts an object into the meta key with all your fields • http://wordpress.org/plugins/wp-rest-api-custom-fields
  • 41. Putting the backend together • A 15-minute REST server with multi-user support, roles and permissions, and an admin interface 1. Enable the aforementioned plugins 2. Setup friendly permalinks 3. Create custom post types if necessary 4. Setup custom fields if necessary 5. API accessible at /wp-json
  • 42.
  • 43. Choosing a static site generator • Comes in pretty much any language: C, C++, Java, Go, Haskell, Erlang, JavaScript, Ruby, Python, PHP, etc. • Choose a language you a comfortable with and enjoy working with • Choose a system that is mature • Choose a system that lets you work with many different types of inputs, including remote content for maximum flexibility
  • 45. Key Features • HTML, Markdown, YAML, and JSON format • Templating language • Asset pipeline • Live reload • Development server • Common preprocessors and concat/minify out of the box
  • 46. Useful Extensions • Deploy • Blog • Pagination • SVG Fallback • Full list: https://directory.middlemanapp.com/#/extensions/all
  • 47. Directory Structure • Data • Lib • Source • Images • Javascripts • Layouts • Stylesheets • Pages, posts, etc
  • 48. Source index.html.md /about Build Data /css /js/img layout.html.erb logo.svg all.scss _header.scss _footer.scss all.js menu.coffee feed.js _header.html.erb /layouts
  • 49. Build index.html /about /css /js/img logo.svg all.css all.js logo.png logo@2x.png
  • 50. Dynamic Files • Data is made available to our templates • Useful for creating menus, lists, directories, etc. • Pages can also be dynamically generated from data
  • 51. sally.html roger.html sue.html steven.html lisa.html people build people.json data
  • 52. Dynamic Pages In config.rb people.each do |person| proxy “people/#{person[‘name’]}.html”, “layout/person.html”, locals: { person: person } end
  • 53. Data Source Library In lib/wordpress.rb class WordPress include HTTParty def initialize(uri) self.class.base_uri uri end def posts @posts ||= self.class.get(‘/posts?type=post’) end end
  • 54. Dynamic Pages from Data Source In config.rb @wordpress = WordPress.new(“http://supersecret.dev/wp-json”) @wordpress.posts.each do |post| proxy “/blog/#{post[‘slug’]}/index.html”, “templates/post.html”, locals: { post: post } end
  • 55. Expose Data Source to Templates In config.rb helpers do def wordpress @wordpress end end
  • 56. Use Data Source in Templates In source/blog/index.html <% wordpress.posts.each do |post| %> <div> <h3><a href=“/blog/<%= post[‘slug’] %>/”><%= post[‘title’] %></a></h3> <div><%= post[‘excerpt’] %></div> </div> <% end %>
  • 57. Nicer than this! <?php
 if (have_posts()) {
 while ( have_posts()) { 
 the_post();
 ?>
 <div>
 <h3><a href=“<?php the_permalink(); ?>”><?php the_title(); ?></a></h3>
 <div><?php the_excerpt(); ?></div>
 </div>
 <?php 
 }
 }
 ?>
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63. There’s a plugin for that • Hookpress • Turns internal hooks into web hooks • Recompile your site when content is updated • https://wordpress.org/plugins/hookpress/