├── theme ├── index.js ├── src │ ├── gatsby-plugin-theme-ui │ │ ├── space.js │ │ ├── sharedStyles.js │ │ ├── sizes.js │ │ ├── components │ │ │ ├── index.js │ │ │ ├── gradients.js │ │ │ ├── cards.js │ │ │ ├── links.js │ │ │ ├── buttons.js │ │ │ ├── pagination.js │ │ │ └── menus.js │ │ ├── colors.js │ │ ├── index.js │ │ └── typo.js │ ├── components │ │ ├── Date.js │ │ ├── FooterContent.js │ │ ├── PostEntryMeta.js │ │ ├── SiteBranding.js │ │ ├── PostEntryInfo.js │ │ ├── Author.js │ │ ├── PostEntryContent.js │ │ ├── Footer.js │ │ ├── Layout.js │ │ ├── PostEntryTitle.js │ │ ├── PostEntryMedia.js │ │ ├── Tags.js │ │ ├── Categories.js │ │ ├── PostEntry.js │ │ ├── Pagination.js │ │ ├── Seo.js │ │ ├── Header.js │ │ └── Menu.js │ ├── utils │ │ └── index.js │ ├── pages │ │ └── 404.js │ ├── templates │ │ ├── posts │ │ │ ├── singlePost.js │ │ │ └── archivePosts.js │ │ ├── pages │ │ │ └── singlePage.js │ │ ├── categories │ │ │ └── singleCategory.js │ │ ├── tags │ │ │ └── singleTag.js │ │ └── users │ │ │ └── singleUser.js │ └── styles │ │ └── GlobalStyles.js ├── .prettierrc ├── gatsby-node.js ├── LICENSE ├── .gitignore ├── package.json ├── utils │ ├── createTags.js │ ├── createUsers.js │ ├── createCategories.js │ ├── createSitePages.js │ └── createPosts.js ├── gatsby-config.js └── README.md ├── netlify.toml ├── package.json ├── demo ├── static │ └── favicon.ico ├── config.js ├── .prettierrc ├── src │ └── @alexadark │ │ └── gatsby-theme-wordpress-blog │ │ ├── gatsby-plugin-theme-ui │ │ └── colors.js │ │ └── components │ │ └── FooterContent.js ├── package.json ├── gatsby-config.js ├── LICENSE ├── .gitignore └── README.md ├── .gitignore └── README.md /theme/index.js: -------------------------------------------------------------------------------- 1 | // boop 2 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | base = "demo" 3 | command = "yarn build" 4 | publish = "demo/public" 5 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/space.js: -------------------------------------------------------------------------------- 1 | export const space = [0, 10, 20, 30, 40, 50, 60, 120, 240] 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": [ 4 | "theme", 5 | "demo" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /demo/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexadark/gatsby-wordpress-theme-blog/HEAD/demo/static/favicon.ico -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/sharedStyles.js: -------------------------------------------------------------------------------- 1 | export const transitions = ['all .2s ease-in-out', 'all .4s ease-in-out'] 2 | -------------------------------------------------------------------------------- /demo/config.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | wordPressUrl: `http://alexandraspalato.com/gatsby/`, 3 | } 4 | 5 | module.exports = config 6 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/sizes.js: -------------------------------------------------------------------------------- 1 | export const sizes = { 2 | s: 540, 3 | m: 720, 4 | l: 1024, 5 | xl: 1200, 6 | } 7 | -------------------------------------------------------------------------------- /demo/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": false, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /theme/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": false, 4 | "singleQuote": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /theme/src/components/Date.js: -------------------------------------------------------------------------------- 1 | import moment from "moment/moment" 2 | 3 | const Date = ({ date }) => moment(date).format(`MMMM D, YYYY`) 4 | 5 | export default Date 6 | -------------------------------------------------------------------------------- /theme/src/utils/index.js: -------------------------------------------------------------------------------- 1 | export const createLocalLink = (url, wordPressUrl) => { 2 | if (`#` === url) { 3 | return null 4 | } 5 | return url.replace(wordPressUrl, ``) 6 | } 7 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/components/index.js: -------------------------------------------------------------------------------- 1 | export * from './buttons' 2 | export * from './links' 3 | export * from './menus' 4 | export * from './cards' 5 | export * from './pagination' 6 | export * from './gradients' 7 | -------------------------------------------------------------------------------- /demo/src/@alexadark/gatsby-theme-wordpress-blog/gatsby-plugin-theme-ui/colors.js: -------------------------------------------------------------------------------- 1 | import merge from "lodash.merge" 2 | import colors from "@alexadark/gatsby-theme-wordpress-blog/src/gatsby-plugin-theme-ui/colors" 3 | 4 | export default merge({}, colors, { 5 | // primary: "tomato", 6 | }) 7 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/components/gradients.js: -------------------------------------------------------------------------------- 1 | export const gradients = { 2 | primary: { 3 | backgroundImage: t => 4 | `linear-gradient(45deg, ${t.colors.primary}, ${t.colors.purple[7]})`, 5 | }, 6 | secondary: { 7 | backgroundImage: t => 8 | `linear-gradient(45deg, ${t.colors.secondary}, ${t.colors.purple[6]})`, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /theme/src/components/FooterContent.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const FooterContent = () => { 4 | return ( 5 | <> 6 | © {new Date().getFullYear()} | Built with{` `} 7 | WPGraphQL and{` `} 8 | Gatsby 9 | 10 | ) 11 | } 12 | 13 | export default FooterContent 14 | -------------------------------------------------------------------------------- /theme/src/components/PostEntryMeta.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx } from "theme-ui" 3 | import Categories from "./Categories" 4 | import Tags from "./Tags" 5 | 6 | const PostEntryMeta = ({ post }) => { 7 | return ( 8 |
9 | 10 | 11 |
12 | ) 13 | } 14 | 15 | export default PostEntryMeta 16 | -------------------------------------------------------------------------------- /demo/src/@alexadark/gatsby-theme-wordpress-blog/components/FooterContent.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | const FooterContent = () => { 4 | return ( 5 | <> 6 | © {new Date().getFullYear()} | Built with{` `} 7 | WPGraphQL and{` `} 8 | Gatsbyyyy 9 | 10 | ) 11 | } 12 | 13 | export default FooterContent 14 | -------------------------------------------------------------------------------- /theme/src/pages/404.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | import Layout from "../components/Layout" 4 | import Seo from "../components/Seo" 5 | 6 | const NotFoundPage = ({ location }) => ( 7 | 8 | 9 |

NOT FOUND

10 |

You just hit a route that doesn't exist... the sadness.

11 |
12 | ) 13 | 14 | export default NotFoundPage 15 | -------------------------------------------------------------------------------- /theme/src/components/SiteBranding.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, Styled } from 'theme-ui' 3 | import { Link } from 'gatsby' 4 | 5 | const SiteBranding = ({ title }) => { 6 | return ( 7 | 8 | 9 | {title} 10 | 11 | 12 | ) 13 | } 14 | 15 | export default SiteBranding 16 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/colors.js: -------------------------------------------------------------------------------- 1 | import { tailwind } from '@theme-ui/presets' 2 | export default { 3 | ...tailwind.colors, 4 | primary: `tomato`, 5 | secondary: tailwind.colors.blue[9], 6 | background: tailwind.colors.light, 7 | textMuted: `#667488`, 8 | text: `#444`, 9 | grayDark: tailwind.colors.gray[9], 10 | dark: tailwind.colors.gray[7], 11 | muted: tailwind.colors.gray[5], 12 | light: tailwind.colors.gray[3], 13 | } 14 | -------------------------------------------------------------------------------- /theme/src/components/PostEntryInfo.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx } from 'theme-ui' 3 | import Date from './Date' 4 | import Author from './Author' 5 | 6 | const PostEntryInfo = ({ post }) => { 7 | return ( 8 |
9 | Posted on: by{' '} 10 | 11 |
12 | ) 13 | } 14 | 15 | export default PostEntryInfo 16 | -------------------------------------------------------------------------------- /theme/src/components/Author.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, Styled } from 'theme-ui' 3 | import { Link } from 'gatsby' 4 | 5 | const Author = ({ post }) => { 6 | const { name, slug } = post.author 7 | return ( 8 | 16 | {name} 17 | 18 | ) 19 | } 20 | 21 | export default Author 22 | -------------------------------------------------------------------------------- /theme/src/components/PostEntryContent.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, Styled } from 'theme-ui' 3 | 4 | const PostEntryContent = ({ post, location }) => { 5 | const content = location === 'single' ? post.content : post.excerpt 6 | return ( 7 | 16 | ) 17 | } 18 | 19 | export default PostEntryContent 20 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/components/cards.js: -------------------------------------------------------------------------------- 1 | const sharedCardStyles = { 2 | boxShadow: `lg`, 3 | borderRadius: 10, 4 | fontFamily: `body`, 5 | '.entry-title': { 6 | mt: 0, 7 | }, 8 | '.content': { 9 | p: [2, 5], 10 | }, 11 | } 12 | 13 | export const cards = { 14 | white: { 15 | ...sharedCardStyles, 16 | bg: `white`, 17 | }, 18 | primary: { 19 | ...sharedCardStyles, 20 | bg: `primary`, 21 | }, 22 | secondary: { 23 | ...sharedCardStyles, 24 | bg: `secondary`, 25 | }, 26 | muted: { 27 | ...sharedCardStyles, 28 | bg: `muted`, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/components/links.js: -------------------------------------------------------------------------------- 1 | import { a } from '../typo' 2 | 3 | export const links = { 4 | decorated: { 5 | ...a, 6 | color: `muted`, 7 | position: `relative`, 8 | 9 | ':before': { 10 | content: `""`, 11 | width: `50%`, 12 | height: `50%`, 13 | position: `absolute`, 14 | left: `-5px`, 15 | bottom: 0, 16 | bg: `primary`, 17 | opacity: 0.3, 18 | transition: `all .4s ease-in-out`, 19 | }, 20 | ':hover': { 21 | color: `primary`, 22 | ':before': { 23 | width: `110%`, 24 | }, 25 | }, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "demo", 4 | "version": "0.1.0", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "gatsby build", 8 | "develop": "gatsby develop", 9 | "format": "prettier --write src/**/*.{js,jsx}", 10 | "start": "npm run develop", 11 | "serve": "gatsby serve", 12 | "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\"" 13 | }, 14 | "dependencies": { 15 | "gatsby": "^2.13.1", 16 | "@alexadark/gatsby-theme-wordpress-blog": "*", 17 | "lodash.merge": "^4.6.2", 18 | "react": "^16.8.6", 19 | "react-dom": "^16.8.6" 20 | }, 21 | "devDependencies": { 22 | "prettier": "^1.18.2" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /theme/src/components/Footer.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { Container, Footer as StyledFooter, jsx } from 'theme-ui' 3 | import FooterContent from './FooterContent' 4 | 5 | const Footer = () => ( 6 | 7 | 21 | 22 | 23 | 24 | ) 25 | 26 | export default Footer 27 | -------------------------------------------------------------------------------- /theme/gatsby-node.js: -------------------------------------------------------------------------------- 1 | const createPosts = require(`./utils/createPosts`) 2 | const createSitePages = require(`./utils/createSitePages`) 3 | const createCategories = require(`./utils/createCategories`) 4 | const createTags = require(`./utils/createTags`) 5 | const createUsers = require(`./utils/createUsers`) 6 | 7 | exports.createPages = async ({ actions, graphql, reporter }, options) => { 8 | reporter.warn("make sure to load data from somewhere!") 9 | await createPosts({ actions, graphql }, options) 10 | await createSitePages({ actions, graphql }, options) 11 | await createCategories({ actions, graphql }, options) 12 | await createTags({ actions, graphql }, options) 13 | await createUsers({ actions, graphql }, options) 14 | } 15 | -------------------------------------------------------------------------------- /demo/gatsby-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Configure your Gatsby site with this file. 3 | * 4 | * See: https://www.gatsbyjs.org/docs/gatsby-config/ 5 | */ 6 | const config = require("./config") 7 | 8 | module.exports = { 9 | siteMetadata: { 10 | title: `Gatsby theme WordPress Starter Demo`, 11 | description: `Gatsby starter site for Gatsby Theme Wordpress Theme.`, 12 | author: `@alexadark`, 13 | wordPressUrl: config.wordpressUrl, 14 | }, 15 | plugins: [ 16 | { 17 | resolve: `@alexadark/gatsby-theme-wordpress-blog`, 18 | options: { 19 | wordPressUrl: config.wordPressUrl, 20 | postsPrefix: `posts`, 21 | postsPath: ``, 22 | paginationPrefix: `blog`, 23 | postsPerPage: 8, 24 | }, 25 | }, 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /theme/src/gatsby-plugin-theme-ui/components/buttons.js: -------------------------------------------------------------------------------- 1 | const sharedButtonStyles = { 2 | border: `none`, 3 | color: `white`, 4 | cursor: `pointer`, 5 | fontFamily: `body`, 6 | fontWeight: `bold`, 7 | transition: `all 0.4s ease-in-out`, 8 | letterSpacing: 1, 9 | boxShadow: `md`, 10 | '&:hover': { 11 | transform: `translateY(-5px)`, 12 | boxShadow: `hover`, 13 | }, 14 | } 15 | 16 | export const buttons = { 17 | primary: { 18 | ...sharedButtonStyles, 19 | borderRadius: 5, 20 | variant: `gradients.primary`, 21 | fontSize: 1, 22 | px: 2, 23 | py: 1, 24 | }, 25 | secondary: { 26 | ...sharedButtonStyles, 27 | borderRadius: 5, 28 | variant: `gradients.secondary`, 29 | fontSize: 1, 30 | px: 2, 31 | py: 1, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /theme/src/templates/posts/singlePost.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { graphql } from "gatsby" 3 | import PostEntry from "../../components/PostEntry" 4 | import Layout from "../../components/Layout" 5 | import SEO from "../../components/Seo" 6 | 7 | const SinglePost = ({ data }) => { 8 | const { title, excerpt } = data.wpgraphql.post 9 | 10 | return ( 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | 18 | export default SinglePost 19 | 20 | export const pageQuery = graphql` 21 | query GET_POST($id: ID!) { 22 | wpgraphql { 23 | post(id: $id) { 24 | content 25 | ...PostTemplateFragment 26 | } 27 | } 28 | } 29 | ` 30 | -------------------------------------------------------------------------------- /theme/src/components/Layout.js: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx } from 'theme-ui' 3 | import React from 'react' 4 | import { Global } from '@emotion/core' 5 | import { GlobalStyles } from '../styles/GlobalStyles' 6 | 7 | import Header from './Header.js' 8 | import Footer from './Footer.js' 9 | 10 | import { Layout as StyledLayout, Container } from 'theme-ui' 11 | 12 | const Layout = ({ children }) => ( 13 | <> 14 | 15 | 16 | 25 |
26 | {children} 27 |