Slide 1

Slide 1 text

From WordPress To Gatsby

Slide 2

Slide 2 text

Hello const dimitri = new Person(); ● Dimitri ‘g00glen00b’ Mestdagh ● Full-stack developer at Optis ● Works with Java and JavaScript ● Loves to try out new frameworks ● Blogs often about cool technologies ● https://dimitr.im

Slide 3

Slide 3 text

How do we usually write blog posts?

Slide 4

Slide 4 text

Traditional blogging ● Using a Content Management System ● Server-Side Rendering ● Content is coupled ● Easy usage ● Rich ecosystem of plugins, themes, ...

Slide 5

Slide 5 text

However.... ● It requires additional resources ● Even if content doesn’t change often ● It’s a popular target for hackers

Slide 6

Slide 6 text

What could we do?

Slide 7

Slide 7 text

Meet the static site generator ● Use a static site generator ● Generate rendered HTML at build time ● Serve static resources ● Content is decoupled

Slide 8

Slide 8 text

Meet Gatsby “Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps” — Taken from https://www.gatsbyjs.org/

Slide 9

Slide 9 text

How does it work? CMS Markdown Other APIs and files GraphQL API HTML + CSS + React Gatsby Datasources static-page 2.html static-page 1.html

Slide 10

Slide 10 text

What is GraphQL? “GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.” — Taken from https://graphql.org/learn/

Slide 11

Slide 11 text

Why a static site generator?

Slide 12

Slide 12 text

Live coding time!

Slide 13

Slide 13 text

Benefits ● Opinionated framework ● Static, and thus blazing fast ● Hydrates back to a full React app ● Headless CMS ● Rich ecosystem of plugins ● React

Slide 14

Slide 14 text

Concerns ● Things working with Markdown don’t necessarily work with other sources ● Results can vary between gatsby develop and gatsby build ● New content requires complete rebuild

Slide 15

Slide 15 text

Resources Slides https://speakerdeck.com/g00glen00b

Slide 16

Slide 16 text

Resources Code https://github.com/g00glen00b/gatsby-blog

Slide 17

Slide 17 text

Resources Tutorials https://dimitr.im/tag/gatsby

Slide 18

Slide 18 text

Resources Introduction blog post: http://bit.ly/OptisGatsby

Slide 19

Slide 19 text

Thank you!