├── gatsby-node.js ├── README.md ├── gatsby-browser.js ├── .prettierrc ├── .prettierignore ├── static └── favicon.ico ├── postcss.config.js ├── tailwind.config.js ├── src ├── styles │ └── global.css ├── pages │ ├── staff.js │ ├── index.js │ └── programs.js ├── components │ ├── Layout.js │ └── Header.js ├── templates │ └── apos-page.js └── assets │ └── rl-logo.svg ├── gatsby-config.js ├── LICENSE ├── package.json └── .gitignore /gatsby-node.js: -------------------------------------------------------------------------------- 1 | const path = require("path") 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Demo for gatsby-source-apostrophe 2 | -------------------------------------------------------------------------------- /gatsby-browser.js: -------------------------------------------------------------------------------- 1 | import "./src/styles/global.css" 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "semi": false 4 | } 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | package.json 3 | package-lock.json 4 | public 5 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apostrophecms/gatsby-demo-apostrophe/main/static/favicon.ico -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | purge: ["./src/**/*.{js,jsx,ts,tsx}"], 3 | darkMode: false, // or 'media' or 'class' 4 | theme: { 5 | extend: {}, 6 | }, 7 | variants: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | -------------------------------------------------------------------------------- /src/styles/global.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | body { 6 | font-family: 'Karla'; 7 | } 8 | 9 | h1, 10 | h2, 11 | h3, 12 | h4 { 13 | font-family: 'Fraunces'; 14 | } 15 | 16 | .rl-rte p { 17 | margin-bottom: 10px; 18 | } -------------------------------------------------------------------------------- /src/pages/staff.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | // import { graphql } from "gatsby" 3 | import Layout from "../components/Layout" 4 | 5 | export default function Staff() { 6 | return ( 7 | <> 8 | 9 |

Camp Staff

10 |
11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | // import { graphql } from "gatsby" 3 | import Layout from "../components/Layout" 4 | 5 | export default function Home({ data }) { 6 | 7 | return ( 8 | <> 9 | 10 |

Welcome to Camp Rainbow Lake

11 |
12 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /src/components/Layout.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Header from "./Header" 3 | 4 | export default function Layout({ children }) { 5 | return ( 6 | <> 7 |
8 |
9 |
{children}
10 |
11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /gatsby-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Configure your Gatsby site with this file. 3 | * 4 | * See: https://www.gatsbyjs.com/docs/gatsby-config/ 5 | */ 6 | require("dotenv").config({ 7 | path: ".env", 8 | }) 9 | 10 | module.exports = { 11 | plugins: [ 12 | "gatsby-plugin-postcss", 13 | { 14 | resolve: `gatsby-plugin-google-fonts`, 15 | options: { 16 | fonts: [`Fraunces\:400`, `Karla\:400`], 17 | display: "swap", 18 | }, 19 | }, 20 | // Add Apostrophe source plugin config here. 21 | ], 22 | } 23 | -------------------------------------------------------------------------------- /src/pages/programs.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Layout from "../components/Layout" 3 | 4 | export default function Programs({ data }) { 5 | 6 | return ( 7 | <> 8 | 9 |

Camp Sessions

10 |
11 | 12 | ) 13 | } 14 | 15 | function formatDate(date) { 16 | const obj = new Date(date) 17 | return obj.toLocaleDateString() 18 | } 19 | 20 | function ageGroupToRange(group) { 21 | return group.split("to") 22 | .map(n => parseInt(n)) 23 | .join(" - ") 24 | } -------------------------------------------------------------------------------- /src/templates/apos-page.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { graphql } from "gatsby" 3 | import Layout from "../components/Layout" 4 | 5 | export default function AposPage({ data }) { 6 | const page = data && data.aposCorePage 7 | let subNav = [] 8 | 9 | return ( 10 | 11 | <> 12 |
13 |

{page.title || ""}

14 | {!!subNav.length && ( 15 | 19 | )} 20 |
21 | {page._rendered && ( 22 |
23 | )} 24 | 25 | 26 | ) 27 | } 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Apostrophe Technologies, Inc. 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-demo-apostrophe", 3 | "private": true, 4 | "description": "A demo Gatsby site using the ApostropheCMS source plugin", 5 | "version": "1.0.0", 6 | "license": "0BSD", 7 | "scripts": { 8 | "build": "gatsby build", 9 | "develop": "gatsby develop", 10 | "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", 11 | "start": "npm run develop", 12 | "serve": "gatsby serve", 13 | "clean": "gatsby clean", 14 | "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" 15 | }, 16 | "dependencies": { 17 | "autoprefixer": "^10.2.3", 18 | "dotenv": "^8.2.0", 19 | "gatsby": "^2.31.1", 20 | "gatsby-plugin-google-fonts": "^1.0.1", 21 | "gatsby-plugin-postcss": "^3.6.0", 22 | "gatsby-source-apostrophe": "^1.0.0", 23 | "postcss": "^8.2.4", 24 | "react": "^16.12.0", 25 | "react-dom": "^16.12.0", 26 | "tailwindcss": "^2.0.2" 27 | }, 28 | "devDependencies": { 29 | "prettier": "2.2.1" 30 | }, 31 | "repository": { 32 | "type": "git", 33 | "url": "https://github.com/apostrophecms/gatsby-demo-apostrophe" 34 | }, 35 | "bugs": { 36 | "url": "https://github.com/gatsbyjs/gatsby/issues" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # dotenv environment variable files 55 | .env* 56 | 57 | # gatsby files 58 | .cache/ 59 | public 60 | 61 | # Mac files 62 | .DS_Store 63 | 64 | # Yarn 65 | yarn-error.log 66 | .pnp/ 67 | .pnp.js 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { useStaticQuery, graphql, Link } from "gatsby" 3 | import logo from "../assets/rl-logo.svg" 4 | 5 | export default function Header() { 6 | const data = useStaticQuery(graphql` 7 | query MainNav { 8 | allSitePage( 9 | filter: { path: { nin: ["/dev-404-page/", "/"] } } 10 | sort: { fields: [path], order: ASC } 11 | ) { 12 | edges { 13 | node { 14 | context { 15 | title 16 | slug 17 | } 18 | } 19 | } 20 | } 21 | } 22 | `) 23 | let nav = [] 24 | if ( 25 | data && 26 | data.allSitePage && 27 | data.allSitePage.edges && 28 | data.allSitePage.edges.length 29 | ) { 30 | nav = data.allSitePage.edges 31 | .map(e => ({ 32 | title: e.node.context.title, 33 | slug: e.node.context.slug, 34 | })) 35 | // Only include top level items. 36 | .filter(node => { 37 | return node.slug && node.slug.split("/").length === 2 38 | }) 39 | } 40 | 41 | const linkClasses = "text-blue-500 hover:text-blue-800" 42 | 43 | return ( 44 |
45 | 46 | Rainbow Lake Camp 47 | 48 | 71 |
72 | ) 73 | } 74 | -------------------------------------------------------------------------------- /src/assets/rl-logo.svg: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------