• This repository has been archived on 18/Jul/2022
  • Stars
    star
    308
  • Rank 135,712 (Top 3 %)
  • Language
    JavaScript
  • Created almost 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A zero component Gatsby theme for developers ๐Ÿ”‹
gatsby-theme-termninal main image

gatsby-theme-terminal

Gatsby Theme Terminal aims to be a zero component theme. It provides data components to aid in the abstraction of presentational and data layers which together provide the most flexibility

The theme handles the data but how it's displayed is up to you!

You can create any page layout or component combination you like using your own components or components provided by theme-ui/components

๐Ÿ‘€ Preview

๐Ÿš€ Getting started

To help you get started you can either clone the starter gatsby-starter-terminal or read the below.

Install

npm install @pauliescanlon/gatsby-theme-terminal

Install Peer Dependencies

npm install @mdx-js/mdx @mdx-js/react gatsby gatsby-plugin-mdx gatsby-source-filesystem react react-dom

Setup

gatsby-config.js

Add the siteMetaData and @pauliescanlon/gatsby-theme-terminal to your gatsby-config.js

// gatsby-config.js
module.exports = {
  siteMetadata: {
    name: "Your blog title",
    description: "I like tech",
    keywords: ["tech", "blog", "boop"],
    siteUrl: 'https://gatsby-theme-terminal.netlify.com',
    siteImage: 'name-of-open-graph-image.jpg', // pop an image in the static folder to use it as the og:image,
    profileImage: 'name-of-profile-image.jpg'
    lang: `eng`,
    config: {
      sidebarWidth: 240 // optional,
    },
  },
  plugins: ['@pauliescanlon/gatsby-theme-terminal']
}

directory structure

To add pages create .mdx files in the src/pages directory. You need at least one file called index.mdx located at src/pages or you'll see a GraphQL error.

|-- src
    |-- pages
        |-- index.mdx
        |-- about.mdx
        |-- contact.mdx 

frontmatter setup

Pages

Pages must include navigationLabel in the frontmatter

// src/pages/about.mdx
---
navigationLabel: About
---

# About

This is about page

Theme options

Additional .mdx can be sourced from anywhere outside the pages directory but you need to tell the theme where to source these files from.

Use the source option in gatsby-config.js

// gatsby-config.js
...
  plugins: [
    {
      resolve: `@pauliescanlon/gatsby-theme-terminal`,
      options: {
        source: [
          {
            name: "posts",
            dir: "posts",
          },
          {
            name: "projects",
            dir: "projects",
          },
        ] // can be an object or array of objects

      },
    },
  ],
}

Then create the relevant files and directories

|-- src
    |-- pages
    ...
    |-- posts 
      |--2020
        |--02
          |-- some-post.mdx
          |-- featuredImage: markus-spiske-466ENaLuhLY-unsplash.jpg
          |-- markus-spiske-FXFz-sW0uwo-unsplash.jpg
    |-- projects
      |-- some-project.mdx  

Any file that is not sourced from pages can contain any of the following frontmatter but a title is required, this is how the theme distinguishes between pages and other .mdx files

// src/posts/2020/02/some-post.mdx
---
title: Some Post
tags: ["JavaScript", "React", "GatsbyJs", "HTML", "CSS", "theme-ui"]
date: 2020-01-01
dateModified: 20-20-2020
author: Paul Scanlon
status: draft // => means it won't be rendered
isPrivate: // => it will be rendered but you can use this prop as a filter
url: "https://example.com"  // => could be an external url
misc: "Ahoy" // => use how you wish
pinned: false // => Could be used as a filter for pinned posts
featuredImage: markus-spiske-466ENaLuhLY-unsplash.jpg
featuredImageUrl: https://via.placeholder.com/936x528
embeddedImages:
  - markus-spiske-FXFz-sW0uwo-unsplash.jpg
embeddedImageUrls:
  - https://via.placeholder.com/468x264
---

Embedded Images

By using the The <GatsbyImage /> component from gatsby-plugin-image you can pass the image data queried by GraphQL and pass it on via the image prop

The gatsbyImageData, data is available via props.embedded.image(n)

<GatsbyImage image={props.embedded.image1} />

You can also use the Theme UI <Image /> component by passing it a src

<Image src={props.embedded.image1.gatsbyImageData.images.fallback.src} />

image1 in this example would be markus-spiske-FXFz-sW0uwo-unsplash.jpg

EmbeddedImages can also be sourced from a remote url, in this case use the <Image /> component and pass it the same props

<Image src={props.embedded.image2.gatsbyImageData.images.fallback.src} />

markdown

The theme supports the complete markdown spec and you can see how to use markdown in the demo

theme-ui/components

The theme supports all the components provided by theme-ui/components and you can see in the demo how they are used.

gatsby-theme-terminal/components

The theme also comes with it's own components but... These are purely to provide access to the source nodes. What you choose to render is completely up to you!

For example to display a list of all files sourced from the source theme option you could do something like this. This component can be used in ANY .mdx file ๐Ÿ˜Ž

<SourceList>
  {(source) => (
    <ul>
      {source.map((edge, index) => {
        const {
          frontmatter: { title },
        } = edge.node
        return <li key={index}>{title}</li>
      })}
    </ul>
  )}
</SourceList>

You can see more about how to use the theme components in the demo

Component Shadowing

There is very little to shadow because almost everything is exposed by the components but you might want to add your own logo.

To do this create the following directories @pauliescanlon/gatsby-theme-terminal/components/Logo in the src directory of your project and then create a Logo.js file. You can do anything you like in here.

|-- src
    |-- @pauliescanlon
      |-- gatsby-theme-terminal
        |-- components
          |-- Logo
            |-- Logo.js

If you would like to customize any part of the theme you can do so by shadowing the theme file.

To do this create the following directory src/gatsby-plugin-theme-ui and then create an index.js

// src/gatsby-plugin-theme-ui/index.js

import baseTheme from '@pauliescanlon/gatsby-theme-terminal/src/gatsby-plugin-theme-ui'

export default {
  ...baseTheme,
  colors: {
    ...baseTheme.colors,
    primary: '#FF4081',
    secondary: '#03A9F4',
    success: '#FFEB3B',
    background: '#232323',
    surface: '#393939',
  },
}

favicon

favicon(s) need to be saved in static/images and named favicon-16x16.png and favicon-32x32.png along with an .icon file called favicon.ico

If you're using gatsby-theme-terminal in your project i'd love to hear from you @pauliescanlon

ko-fi

More Repositories

1

mdx-embed

Embed 3rd party media content in MDX - no import required ๐Ÿงฝ
TypeScript
272
star
2

gatsby-mdx-embed

A Gatsby MDX plugin to embed Twitter, YouTube, Instagram and many more in to your .mdx without import ๐Ÿงผ
TypeScript
105
star
3

skin-ui

A Theme UI Live Preview and Code Editor ๐ŸŽŸ๏ธ
JavaScript
72
star
4

simple-react-ssr-vite-express

Simple React SSR with Vite and Express
JavaScript
36
star
5

paulie-dev-2019

A Content Rich SSG Gatsby Website with Serverless Functions and SSR
JavaScript
35
star
6

gatsby-theme-gatstats

A Gatsby theme and dashboard for your tech blog... or a dashblog if you prefer ๐Ÿคทโ€โ™‚๏ธ
TypeScript
35
star
7

react-svg-bubble-slider

A React version of Chris Gannon's SVG Bubble Slider ๐Ÿ’ฌ
TypeScript
32
star
8

fauna-gatsby-comments

Roll your own comments with Gatsby and FaunaDB ๐Ÿ—ž๏ธ
JavaScript
29
star
9

nextjs-google-sheets-database

Use Google Sheets as a Database
TypeScript
27
star
10

gatsby-plugin-prop-shop

A Gatsby plugin that provides an holistic view of all defined PropTypes ๐Ÿš
JavaScript
16
star
11

gatsby-mdx-routes

A Gatsby mdx plugin to create navigation menus for your .mdx files ๐ŸšŒ
TypeScript
15
star
12

gatsby-starter-terminal

A Gatsby starter for gatsby-theme-terminal
JavaScript
15
star
13

paulie-dev-2023

New paulie.dev site - 2023
MDX
14
star
14

css-conic-gradient-charts

Create Donut or Pie Charts using the CSS conic-gradient
JavaScript
11
star
15

paulie-api

The documentation for Paulie API
JavaScript
10
star
16

cockroachdb-edge-locations

A demo application that logs the locations of Vercel's Global Edge Network
JavaScript
10
star
17

tns-react-3d-globe

A 3D Globe made using react-globe.gl
JavaScript
8
star
18

rise-of-the-robots

Jamstack Creativity, Performance Optimization and Accessibility
JavaScript
8
star
19

gatsby-recipe-storybook-js

A Gatsby recipe to add Storybook to your JavaScript Gatsby project ๐Ÿณ
JavaScript
8
star
20

bumhub

A #SillySiteChallenge for all the GitHub bums
TypeScript
8
star
21

gatsby-multi-source-mdx

A demo repo for Gatsby's File System Route API and multiple location MDX
JavaScript
7
star
22

lazy-load-hero

A lazy-loaded three.js hero animation
JavaScript
7
star
23

the-new-stack-astro-react-sprinkling

A simple Astro site with a sprinkling of React
JavaScript
7
star
24

gatsby-future-shapes

A gatsby-source-wordpress demo
TypeScript
6
star
25

gatsby-mdx-embedded-images

A demo repo for gatsby-plugin-image | gatsby-plugin-mdx and embedded images
JavaScript
6
star
26

pauliescanlon.github.io

A dashboard for GitHub Events
Astro
6
star
27

gatsby-remark-sticky-table

A Gatsby remark plugin that creates sticky header tables for markdown ๐Ÿงฒ
JavaScript
6
star
28

cockroachdb-custom-marketo-forms-with-react

Next.js Test App for Marketo Forms + Tailwind
JavaScript
6
star
29

simple-sidebar-navigation-astro

A simple Astro site with sidebar navigation
Astro
5
star
30

netlify-reactions

A demo Gatsby blog using React Svg Bubble Slider
JavaScript
4
star
31

gatsby-netlify-twitter

Netlify Functions for Twitter API v2
JavaScript
4
star
32

gatsby-google-sheets-database

Use Google Sheets as a Database
JavaScript
4
star
33

multi-region-node-lambda-api

An example of how to build a multi-region Ndoe.js Lambda API using Serverless Framework and AWS
JavaScript
4
star
34

nextjs-ssr-line-chart

Server-side Rendered Svg Line Chart
JavaScript
3
star
35

mdx-embedded-images

A demo repo to show how to use Embedded Images in MDX
HTML
3
star
36

react-three-fiber-globe

A learning and code snippet resource for globes built with three.js / React Three Fiber
JavaScript
3
star
37

gatsby-plugin-image-with-art-direction

A experiment using Gatsby Image
JavaScript
3
star
38

gatsby-apple-store

Demo application using Shopify and Gatsby Cloud
JavaScript
3
star
39

qwik-break-from-react

Take a Qwik Break from React with Astro
JavaScript
3
star
40

tns-astro-site-search

Astro site search using Fuse.js and Qwik
MDX
2
star
41

data-champion-ssr-nyc-weather

A New York Weather App that uses Gatsby SSR
JavaScript
2
star
42

gatsby-recipe-storybook-ts

A Gatsby recipe to add Storybook to your TypeScript Gatsby project ๐Ÿณ
JavaScript
2
star
43

gatsby-local-source-node

A demo repo to for sourcing local data with createNodeId
JavaScript
2
star
44

node-tiny-template

Node Tiny Template is a command line interface for generating templated files of any type.
JavaScript
2
star
45

mr-minimum

An absolutely minimal Gatsby starter
JavaScript
2
star
46

tinder

If i get banned from Twitter/X. Open an issue here.
2
star
47

contentful-quick-start

A Quick Start Guide To Gatsby and Contentful
JavaScript
2
star
48

remix-valhalla-demo-app

Gatsby Valhalla Remix Demo App
JavaScript
2
star
49

pauliescanlon-2020

The professional portfolio of Paul Scanlon
JavaScript
2
star
50

gatsby-gtag-partytown

A demo repo for adding Google Analytics gtag using Partytown to a Gatsby site
JavaScript
2
star
51

animate-motion-race-cars

A simple example of what can be achieved using <animateMotion />
HTML
2
star
52

gatsby-prism-react-renderer-mdx

An example repo showing how to use Formidable's Prism React Renderer with Gatsby and MDX
JavaScript
2
star
53

cockroachdb-pg-promise-nextjs

Getting Started With CockroachDB, pg-promise and Next.js
JavaScript
1
star
54

where-is-iss

A Gatsby Functions Demo
TypeScript
1
star
55

pauls-rubbish-video

A repo that links to all the demo repos and an issue for the RFC
1
star
56

gatsby-shared-functions

A demo repo showing how to share and reuse Serverless Functions
JavaScript
1
star
57

directus-data-source

A demo for querying data from Directus
JavaScript
1
star
58

react-tiny-touch

Touch detection in React for adaptive design.
CSS
1
star
59

gatsby-mdx-theme-routes-api

A demo MDX Gatsby Theme repo using File System Routes API
1
star
60

pauliescanlon-io-2018

The portfolio of Paul Scanlon 2018
TypeScript
1
star
61

rive-kwes-forms

Astro
1
star
62

tns-github-actions-analytics

Google Analytics to Slack Notification using GitHub Actions
JavaScript
1
star
63

contentful-content-querying

Content Querying with Gatsby + Contentful
JavaScript
1
star
64

gatsby-context-api

Example for how to use React's Context API with Gatsby
JavaScript
1
star
65

gatsby-third-party-scripts

A third-party script demo
JavaScript
1
star
66

gatsby-contentful-tutorial

A Gatsby + Contentful example repo
JavaScript
1
star
67

daisy-fay

A React application with server-side rendering and server-side data fetching.
JavaScript
1
star
68

cloud-regions-country-flags

A library to convert cloud provider regions to country flag emojis
JavaScript
1
star
69

gatsby-remark-grid-system

A Gatsby remark plugin for responsive grid systems in markdown ๐Ÿฑ
JavaScript
1
star
70

data-champion-ssg-nyc-news

A New York Times News App that uses Gatsby SSG
JavaScript
1
star
71

gatsby-slow-local-build-times

A demo repo for conditionally sourcing .md files
JavaScript
1
star
72

gatsby-seo-component

A simple demo repo for creating a Gatsby Seo component
JavaScript
1
star
73

choose-your-own-adventure

A gatsby-source-wordpress demo
JavaScript
1
star
74

medium-rss-blog

Test repo for medium RSS to Gatsby blog
JavaScript
1
star
75

supabase-google-remix-netlify

JavaScript
1
star
76

smashing-magazine-where-is-iss

A Gatsby Functions Demo using the Open Notify API to visualize the International Space Station
JavaScript
1
star
77

gatsby-sustainable-web

A gatsby-source-wordpress-demo
TypeScript
1
star
78

neon-edge-analytics-astro-sample

A sample repo for using Edge Analytics with Astro
JavaScript
1
star