Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.
/ rm3l.org Public archive

The static website behind my personal blog and portfolio website, running with the JAMStack. Built with Gatsby, and leveraging a headless Ghost CMS running in a Kubernetes cluster.

License

Notifications You must be signed in to change notification settings

rm3l/rm3l.org

Repository files navigation

rm3l.org

The static website behind rm3l.org, hosted with Netlify, built with Gatsby, and leveraging a headless Ghost Content Management System (CMS) running in a Kubernetes cluster

⚠️ Archived! See this repo for the latest version of this website.

CI Status   Code Analysis   Security Status   Netlify Status

demo

Read more about this migration journey in this blog post.

🛠 Tech Stack

🛠 Installation & Set Up

  1. Clone the repo

    git clone https://github.com/rm3l/rm3l.org my-jamstack-site && cd my-jamstack-site
  2. Install and use the correct version of Node using NVM

    nvm install
  3. Install the Gatsby CLI

    npm install -g gatsby-cli
  4. Install YARN package manager

Follow the instructions here: https://legacy.yarnpkg.com/en/docs/install

  1. Install the project dependencies

    yarn
  2. Set up environment variables and customize the project

Copy the .env.template as a .env file in the repo and customize it accordingly:

GHOST_API_URL=https://my.healdless.ghost.entrypoint
GHOST_CONTENT_API_KEY=my-ghost-blog-content-key
CYPRESS_PROJECT_ID=my-cypress-project-id
CYPRESS_RECORD_KEY=my-cypress-record-key
CONTACT_FORM_ENDPOINT=my-contact-form-endpoint
  • GHOST_API_URL : the URL to the headless Ghost blog
  • GHOST_CONTENT_API_KEY : the Ghost Content API Key, which allows to pull data from a Ghost CMS
  • CYPRESS_PROJECT_ID : the Cypress project Identifier
  • CYPRESS_RECORD_KEY : the Cypress project record key, to use in a Cypress online dashboard
  • CONTACT_FORM_ENDPOINT : the endpoint to call in the contact form

On build servers (CircleCI and Netlify), those are just defined as project-wide environment variables.

  1. Change the site configuration

Edit the src/utils/siteConfig.js file accordingly.

  1. Start the development server

    gatsby develop

Gatsby develop uses the development config in .ghost.json.

🚀 Building and Running for Production

  1. Generate a full static production build

     # Run a production build, locally
     gatsby build
  2. Preview the site as it will appear once deployed

    # Serve a production build, locally
    gatsby serve

Gatsby build uses the production config in .ghost.json.

🚨 Testing

This repository contains few Cypress end-to-end tests that not only make sure the website renders as expected, but also test accessibility (also known as a11y). To do so, the test commands spin up the Gatsby development server and run all the Cypress test specs against the former. You can run the tests using the following command:

 # Runs the tests right away, with no user interaction
 yarn test

or :

 # Interactive test launcher: opens up a Cypress browser for interactively running the tests
 yarn test:open

Deploying with Netlify

This contains 3 config files specifically for deploying with Netlify. A netlify.toml file for build settings, a /static/_headers file with default security headers set for all routes, and /static/_redirects to set Netlify custom domain redirects.

To deploy to your Netlify account, hit the button below.

Deploy to Netlify

You need however to leverage your own Ghost Content API Keys which allow Gatsby to communicate with your Ghost headless blog. For this, I currently set Netlify ENV variables for production builds instead.

Once deployed, I also set up a Ghost + Netlify Integration to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes (e.g., new post published) in the headless Ghost CMS, my website will rebuild on Netlify.

Developed by

License

The MIT License (MIT)

Copyright (c) 2020-2021 Armel Soro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •