Gatsby SSG x Ghost
Intro
Among all SSGs and their awsome ecosystem: https://github.com/myles/awesome-static-generators
I got recently one of them, Gatsby, to work with GhostCMS.
I was recently tinkering here with Ghost and its API for automatic post creation.
Ghost is one of those OSS Selfhostable CMS aka no code website builder that allow to create very cool websites.
Also, their hosted plan mission is great.
About the Web
You know the drill:
Google Speed Test
Test the speed and performance with PageSpeed Insights.
Website Carbon
Website’s carbon footprint and environmental impact.
Web-Check
Performance and uptime using Web-Check’s analytics tool.
There is also a very important one: https://trends.google.com/trends/
- How is your site doing? https://search.google.com/
Gatsby SSG
I was following this gatsby course:
React based framework (open source JS, Meta). https://github.com/gatsbyjs/gatsby
Load Data From Anywhere. Gatsby pulls in data from any data source, whether it’s Markdown files, a headless CMS like Contentful or WordPress, or a REST or GraphQL API.
Use source plugins to load your data, then develop using Gatsby’s uniform GraphQL interface.
Go Beyond Static Websites.
Get all the benefits of static websites with none of the limitations.
Gatsby sites are fully functional React apps, so you can create high-quality, dynamic web apps, from blogs to e-commerce sites to user dashboards.
- You need nodejs installed
- Then see: https://github.com/gatsbyjs/gatsby
About Gatsby plugins
Gatsby plugins are a fundamental part of the Gatsby ecosystem and play a crucial role in extending the functionality of your Gatsby site.
They allow you to add various features, optimize performance, and integrate with external services.
More about Gatsby Plugins 👇
Content Sourcing: Gatsby plugins can help you source content from various data sources, such as Markdown files, JSON, APIs, databases, or even content management systems (CMS) like WordPress, Drupal, or Contentful. Popular content-sourcing plugins include
gatsby-source-filesystemandgatsby-source-contentful.Data Transformation: You can use plugins to transform and manipulate data before it’s used to generate pages. For example, you can use
gatsby-transformer-remarkto process Markdown files and convert them into HTML.Styling and CSS: Gatsby plugins can be used to handle CSS and styling.
gatsby-plugin-sass,gatsby-plugin-styled-components, and others help you manage styles in your Gatsby project.Image Optimization: To optimize images for performance, you can use plugins like
gatsby-plugin-sharpandgatsby-transformer-sharp. These plugins generate multiple image sizes and formats for your site, ensuring that the right image is served based on the user’s device and screen size.SEO and Metadata: Plugins like
gatsby-plugin-react-helmetallow you to set up metadata and SEO tags (such as title, description, and Open Graph tags) for each page.Pagination: If you have a blog or any content that requires pagination, there are plugins like
gatsby-plugin-paginationthat can help you set up pagination for your content.Forms: To handle forms on your site, you can use plugins like
gatsby-plugin-netlify-cmsorgatsby-plugin-formik.Authentication and User Management: Plugins like
gatsby-plugin-firebaseorgatsby-plugin-auth0can be used to integrate authentication and user management into your Gatsby site.Search Functionality: Implementing search functionality can be done using plugins like
gatsby-plugin-elasticlunr-searchorgatsby-plugin-lunr.
https://www.emgoto.com/gatsby-search/
Analytics and Tracking: If you want to track user interactions and gather analytics data, plugins like
gatsby-plugin-google-analyticsorgatsby-plugin-segmentcan be helpful.Performance Optimization: Gatsby is known for its performance, and you can further optimize it with plugins like
gatsby-plugin-offlinefor offline support andgatsby-plugin-preactto reduce bundle size.Localization and Internationalization: To make your site multilingual, you can use plugins like
gatsby-plugin-i18norgatsby-plugin-react-i18next.E-commerce Integration: If you’re building an e-commerce site, plugins like
gatsby-plugin-shopifyorgatsby-source-stripecan help you integrate with e-commerce platforms.Serverless Functions: Gatsby supports serverless functions through plugins like
gatsby-plugin-functions. You can create serverless API endpoints for dynamic functionality.Social Sharing: To enable social sharing features, you can use plugins like
gatsby-plugin-social-sharing.Customization: You can also create your own Gatsby plugins to add custom functionality tailored to your specific needs.
Gatsby’s extensive plugin ecosystem makes it a powerful tool for building modern, performant websites and web applications.
You can easily find and install plugins from the Gatsby plugin library or create your own to extend your site’s capabilities.
You can find Gatsby plugins in the official Gatsby plugin library. Here’s how you can access it:
- Gatsby Plugin Library Website: You can visit the official Gatsby plugin library website at https://www.gatsbyjs.com/plugins/.
This website provides a searchable and categorized list of plugins that you can use in your Gatsby projects.
- Gatsby GitHub Repository: Another way to discover Gatsby plugins is by visiting the Gatsby GitHub repository, specifically the “plugins” section. The repository is located at https://github.com/gatsbyjs/gatsby, and you can find plugins in the “plugins” directory.
- https://www.gatsbyjs.com/docs/how-to/images-and-media/using-gatsby-plugin-image/
- https://ghost.org/docs/jamstack/gatsby/?ref=gatsby.ghost.io#use-cases
Understanding Gatsby
Gatsby is just another SSG based on NodeJS.
Install nodejs, just like we did here
npm install
gatsby developIf you thought that you were done understanding APIs just with REST, you were wrong.
Gatsby uses GraphQL to fetch data from APIs.
And you could pull data from dancing sites to your dancing referal page.
Deploying Gatsby: Any static hosting will do
- Github Pages
- Firebase
- Cloudflare Pages
Themes for Gatsby
I Have found several cool ones here: https://statichunt.com/
Like https://statichunt.com/themes/nextjs-supastarter or https://statichunt.com/themes/gatsby-starter-flat-magazine
With source codes:
https://github.com/vojtaholik/gatsby-theme-simplecast Yes, Podcasts via Gatsby SSG too!
https://github.com/chrisnmorrison/revista-gatsby-blog-magazine
https://github.com/app-generator/gatsbyjs-starter-tailwindplay
https://github.com/app-generator/gatsbyjs-starter-tailwindplay
Podcasts in Gatsby
Similarly to the AstroPod project, we have this in Gatsby:
git clone https://github.com/vojtaholik/gatsby-theme-simplecast
#yarn- HUGO PaperMod
- MIT ❤️
- https://github.com/baobabKoodaa/gatsby-starter-infinite-scroll
- MIT ❤️
- HUGO PaperMod
- Requires Flotiq CMS
- Also available for NextJS
Portoflio Minimal
##rm -rf .git && git init
gatsby new portfolio-minimal https://github.com/konstantinmuenster/gatsby-starter-portfolio-minimal-theme
npm install
gatsby develop
gatsby develop -p 8001
gatsby buildIf you want to deploy statically towards Google Firebase:
gatsby build
npm install -g firebase-tools
#firebase login
#firebase init
firebase deployGatsby 💗 ghost
As we saw, its not hard to get started with Ghost.
Consider these for adding to GhostCMS:
http://localhost:8000/http://localhost:8000/___graphqlhttps://www.gatsbyjs.com/docs/how-to/querying-data/running-queries-with-graphiql/
Starter Ghost
node -v
npm -v
npm install -g gatsby-cli
gatsby --version
##rm -rf .git && git init
gatsby new my-blog https://github.com/TryGhost/gatsby-starter-ghost
#gatsby new portfolio-minimal https://github.com/konstantinmuenster/gatsby-starter-portfolio-minimal-theme
cd my-blog
gatsby develop
gatsby develop -p 8001
gatsby buildThis will start a development server, and you can view your blog at http://localhost:8000.
Conclusions
Responsive Images can seem like a small thing, but it can make a big difference in the performance of your website.
See what Mozilla thinks about them.
Other Websites I’ve Built
- With an option to plug adsense to each of this websites
Content Creator Blog
Real Estate Official Site
Personal Business Landing
All your Links
Blog / Adventures
Mental Health Care SitePhoto centered blogs:
Content Creator Blog
Punto Photo Gallery
Travel Adict Photo Gallery
Photo Gallery BlogBusiness Sites:
Business Website
IoT SaaS Site
Doctor Consultation
IoT SaaS SiteFor IOTECH I used https://github.com/themefisher/bigspring-light-astro
For IORACING - https://github.com/zankhq/astros and before https://github.com/creativetimofficial/astro-launch-ui
For IODOCTOR - https://github.com/mickasmt/astro-nomy
For IOT IOTECHCRAFTS - https://github.com/matt765/Tailcast - Also MIT Licensed
Also, business landing pages for small creators:
FAQ
We can find broken links with Python
How to monitor my Website Status?
You can with tools like UptimeKuma
How to see if a web was changed
Free stock photo sites
If you need high‑quality, royalty‑free images, these sources offer excellent free collections (always double‑check the specific license for each image):
Adobe Stock – Free Collection https://stock.adobe.com/free
StockSnap https://stocksnap.io/
Pexels https://www.pexels.com/
Burst by Shopify https://www.shopify.com/stock-photos
Freerange https://freerangestock.com/
Unsplash https://unsplash.com/
Kaboompics https://kaboompics.com/
Stockvault https://www.stockvault.net/
Wikimedia Commons https://commons.wikimedia.org/wiki/Main_Page
Pixabay https://pixabay.com/
what it is a CDN?
A CDN (Content Delivery Network) is:
- A distributed network of servers placed in many data centers around the world.
- Goal: deliver web content (images, CSS/JS files, videos, HTML, APIs, etc.) to users faster and more reliably.
How a CDN works:
- You request a file (e.g. an image on a blog).
- Instead of always coming from your origin server, the file is cached on edge servers of the CDN.
- The CDN serves the file from the closest edge location to the user (geographically / network‑wise).
- If it’s not cached yet, the CDN fetches it from the origin once, then caches it for future users.
Why people use a CDN
- Speed: lower latency, faster page load (better for UX and SEO).
- Offload origin: fewer direct hits to your main server, saving bandwidth and CPU.
- Scalability: easier to handle traffic spikes.
- Resilience: many CDNs provide DDoS protection and failover.
Cloudflare started as a CDN, but today it’s more like a full edge platform: a CDN plus DNS, security (DDoS/WAF), and even compute and storage, all sitting in front of your origin server
There are F/OSS CDNs if you need one.
Apache Traffic Control is an Open Source implementation of a Content Delivery Network
Apache Traffic Control allows you to build a large scale content delivery network using open source. Built around Apache Traffic Server as the caching software, Traffic Control implements all the core functions of a modern CDN.
CDNjs
MIT | 🤖 CDN assets - The #1 free and open source CDN built to make life easier for developers.
cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 billion requests each month, powered by Cloudflare.
They have a F/OSS Static Website where we can find the packages to use via CDNjs - https://github.com/cdnjs/static-website
JSDelivr
A free, fast, and reliable Open Source CDN for npm, GitHub, Javascript, and ESM
