OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source...

18
by Maedah Batool OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION

Transcript of OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source...

Page 1: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

by Maedah Batool

OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION

Page 2: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local meetup chapters.

While working as a Content Strategist I’m a featured/published author at Scotch.io, TorqueMag, Envato Tuts+, SitePoint, Creative Market, etc. Also one of the Marketing Representatives at the official Make #WordPressMarketingTeam.

I created a tech-training startup called FinkTanks through which I’ve taught 5,500+ girls how to code with WordPress.

I collaborate with the Nodejs Foundation Community Committee on the Outreach Initiative.

You can find me on Twitter sharing dev tips @MaedahBatool →

OPEN-SOURCE DEVELOPER ADVOCATE & COMMUNITY PROGRAM MANAGER

👋 HELLOMAEDAH BATOOL

Page 3: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

FOLLOW ME ON TWITTER

@MaedahBatool" #GirlDevMinute Series

🧐 Development tips, tricks, etc.

👀 Find rants, jokes, and whatnotAnd on GitHub, MaedahBatool.com, LinkedIn …

Page 4: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

🤔 BASICS

• Development

• Staging

• Production

PHASES OF WEBSITE DEVELOPMENT

Page 5: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

React.js · Vue.js · Angular · Next.js · Gatsby.js

OPTIMIZING

GATSBY.JS SITES FOR PRODUCTION

Page 6: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Gatsby is a free and open-source

React.js based framework that

helps developers build blazing

fast websites and apps.

THE

GATSBY.JS

Page 7: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

🤔 RECAP

• TALK: https://Maedah.dev/WordSeshMay2019

• TUTORIAL: https://Maedah.dev/wpgatsbyjs

INTEGRATINGGATSBY + WORDPRESS

Page 8: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

You have to ensure that search engines like Google can

understand your site's architecture and index it intelligently.

That’s what sitemaps do.

SITEMAPS

Making your site content visually appealing is quite critical. Media

elements like images, GIFs and videos help you in this respect.

But rendering these is a difficult thing to do.

VIDEOS

Writing web pages in markdown is a super easy programming practice.

If your site supports and reads through folders which have .md files,

that’s awesome.

MARKDOWNGATSBY.JSOPTIMIZATION FOR SITE PRODUCTION

Page 9: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Final build for production and deploying on services

like Netlify.

Build & Deploy

Generates a .xml file making your site content available

In subscribable format.

RSS feed

GATSBY.JSOPTIMIZATION FOR SITE PRODUCTION

Page 10: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

PLUGIN:

SITEMAPS GATSBY-PLUGIN-SITEMAP

Page 11: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Main Plugin:

Install:

DETAILS ABOUT SITEMAPS IN GATSBY.JS SITE

SITE INFORMATION

Maintains a list of all pages to tell search engines like Google

about the organization of your site content.

INDEXING

Sitemaps tell the search engines about an unindexed

page to get it appropriately indexed.

EQUALLY IMPORTANT

For new and old sites. But new website needs a sitemap

since it is difficult for search engines to find posts and pages

of a new site.

ADDINGCUSTOM SITEMAPS

Page 12: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

MARKDOWN PAGESPLUGIN: GATSBY-SOURCE-FILESYSTEM

Page 13: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Main Plugin:

Install:

Pre-Req. Plugin:

Install:

DETAILS ABOUT MARKDOWN IN GATSBY.JS SITE

READ .md Files

Gatsby plugins can read folders/files with markdown

and create pages from them.

SUPPORT FOR MARKDOWN

Is important since writing in markdown is always

easy of eyes, user friendly with less errors.

PROCESS

Reads files from filesystem. Transforms markdown to html

and frontmatter to data. Create page components.

ADDINGMARKDOWN PAGES

Page 14: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

EMBEDDING VIDEOSPLUGIN: GATSBY-REMARK-EMBED-VIDEO

Page 15: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Main Plugin:

Install:

Pre-Req. Plugins:

DETAILS ABOUT EMBEDDING VIDEOS IN GATSBY.JS SITE

MEDIA FILES

Different web applications render media files especially

videos and GIFs differently.

EMBED IN MARKDOWN

Plugins helps you source videos from a variety of video

hosts like YouTube, Vimeo, Dailymotion, etc.

IMPORTANT ALERT

If you’re using the gatsby-remark-responsive-iframe plugin,

you have to ensure that the gatsby-remark-embed-video

plugin is defined first.

EMBEDDINGVIDEOS

Page 16: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

PLUGIN:

RSS Feed GATSBY-PLUGIN-FEED

Page 17: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

Main Plugin:

Install:

Pre-Req. Plugins:

DETAILS ABOUT RSS FEED IN GATSBY.JS SITE

SUBSCRIBABLE CONTENT

Makes your site content easy to subscribe

through feed reader apps.

IMPLEMENTATION

Runs only in production builds and generates

a rss.xml file in the public folder.

CUSTOMIZE & CONFIGURE

Easy to customise solution and options with

Markdown.

ADDINGRSS Feed

Page 18: OPTIMIZING YOUR GATSBY SITE FOR PRODUCTION...I am a WordPress Core Contributor, Open-source Journalist, Developer and a teacher. Maintainer of #GirlsWhoCode and #ReactJSLadies local

FOLLOW ME ON TWITTER

@MaedahBatool/MaedahBatool/WordSesh-Sept-2019

https://Maedah.dev/WDSlidesSep19And on GitHub, MaedahBatool.com, LinkedIn …

QUESTIONS"