Skip to content

Commit

Permalink
replaces with gatsby site
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Jan 17, 2023
1 parent 537686e commit babdda9
Show file tree
Hide file tree
Showing 77 changed files with 71,888 additions and 33 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6,116 changes: 6,116 additions & 0 deletions .contentful/landing-page-model-and-content.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .gitignore copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.cache
public
node_modules
.env
.env.development
.env.production
.contentful/export-model-and-content.json
.yarn
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.cache
public
static
node_modules
.vscode
.idea
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 2 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "@fontsource/inter/400.css";
import "@fontsource/inter/600.css";
49 changes: 49 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
});

const contentfulConfig = {
spaceId: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
};

if (process.env.CONTENTFUL_HOST) {
contentfulConfig.host = process.env.CONTENTFUL_HOST;
contentfulConfig.accessToken = process.env.CONTENTFUL_PREVIEW_ACCESS_TOKEN;
}

const { spaceId, accessToken } = contentfulConfig;

if (!spaceId || !accessToken) {
throw new Error(
"Contentful spaceId and the access token need to be provided. Received: " +
JSON.stringify(contentfulConfig)
);
}

// starter config
module.exports = {
siteMetadata: {
title: "Gatsby Starter Landing Page",
description:
"Create custom landing pages using Gatsby and Contentful with this Gatsby Starter",
},
plugins: [
{
resolve: `gatsby-theme-landing-page`,
options: contentfulConfig,
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Gatsby Starter Landing Page`,
short_name: `Gatsby Starter Landing Page`,
start_url: `/`,
background_color: `#fff`,
theme_color: `#000`,
display: `browser`,
icon: `src/assets/favicon.png`,
},
},
],
};
37 changes: 37 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions;
const typeDefs = `
type ContentfulLandingPage implements ContentfulReference & ContentfulEntry & Node @dontInfer {
name: String
slug: String
noIndex: Boolean
title: String
description: String
image: ContentfulAsset @link(by: "id", from: "image___NODE")
sections: [ContentfulLandingPageSection] @link(by: "id", from: "sections___NODE")
}
type ContentfulLandingPageSection implements ContentfulReference & ContentfulEntry & Node @dontInfer {
name: String
component: String
heading: String
content: [ContentfulLandingPageContent] @link(by: "id", from: "content___NODE")
secondaryHeading: String
}
type ContentfulLandingPageContent implements ContentfulReference & ContentfulEntry & Node @dontInfer {
name: String
image: ContentfulAsset @link(by: "id", from: "image___NODE")
links: [ContentfulLink] @link(by: "id", from: "links___NODE")
primaryText: contentfulLandingPageContentPrimaryTextTextNode @link(by: "id", from: "primaryText___NODE")
secondaryText: contentfulLandingPageContentSecondaryTextTextNode @link(by: "id", from: "secondaryText___NODE")
}
type ContentfulLink implements ContentfulReference & ContentfulEntry & Node @dontInfer {
href: String
text: String
}
`;

createTypes(typeDefs);
};
Loading

0 comments on commit babdda9

Please sign in to comment.