Skip to content

Instantly share code, notes, and snippets.

View domtaylor's full-sized avatar

delta9 domtaylor

View GitHub Profile
@domtaylor
domtaylor / BlogRoll.js
Created June 3, 2020 15:04
blog roll component
import React from 'react'
import PropTypes from 'prop-types'
import { Link, graphql, StaticQuery } from 'gatsby'
import PreviewCompatibleImage from './PreviewCompatibleImage'
class BlogRoll extends React.Component {
render() {
const { data } = this.props
const { edges: posts } = data.allMarkdownRemark
@domtaylor
domtaylor / index.js
Last active June 3, 2020 15:03
Blog > index.js
import React from 'react'
import { Link } from 'gatsby'
import Layout from '../../components/Layout'
import BlogRoll from '../../components/BlogRoll'
import SEO from '../../components/SEO'
const PaginationLink = props => {
if (!props.test) {
const _ = require('lodash')
const path = require('path')
const { createFilePath } = require('gatsby-source-filesystem')
const { fmImagesToRelative } = require('gatsby-remark-relative-images')
const createPaginatedPages = require('gatsby-paginate')
// Remove trailing slashes unless it's only "/", then leave it as it is
const replaceTrailing = _path => (_path === `/` ? _path : _path.replace(/\/$/, ``))
exports.createPages = ({ actions, graphql }) => {
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
require(`dotenv`).config();
module.exports = {
siteMetadata: {
title: `GraphCMS SWAG Store`,
description: `Super cool SWAG from your favourite GraphQL CMS!`,
siteUrl: `https://store.graphcms.com`,
},
plugins: [
`gatsby-plugin-postcss`,