Skip to content

Commit

Permalink
feat: implement @atsnek/jaen and fix several bugs and issues
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Sep 16, 2023
1 parent 9179790 commit 390b71f
Show file tree
Hide file tree
Showing 116 changed files with 4,228 additions and 7,557 deletions.
37 changes: 3 additions & 34 deletions gatsby-browser.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/browser-apis/
*/
export const wrapPageElement = ({element, props}) => {
console.log('wrapPageElement', props)

// You can delete this file if you're not using it

import {GatsbyBrowser} from 'gatsby'

import {Layout} from './src/Layout'
import './src/styles/global.css'

export const wrapPageElement: GatsbyBrowser['wrapPageElement'] = ({
element,
props
}) => {
if (props.location.pathname.startsWith('/admin')) {
return <>{element}</>
}

return <Layout {...props}>{element}</Layout>
return element
}

// export const shouldUpdateScroll: GatsbyBrowser['shouldUpdateScroll'] = ({
// routerProps: {location}
// }) => {
// // check if restoreScroll is set on the location
// if (location.state?.noScroll) {
// // if yes, use the state to scroll to the respective position
// return false
// }

// // use default scroll behavior
// return true
// }
43 changes: 3 additions & 40 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import type {GatsbyConfig} from 'gatsby'
import path from 'path'
import {JaenSource} from 'jaen-utils'
import {IJaenPage} from '@snek-at/jaen'

JaenSource.jaenData.read()

const siteUrl =
JaenSource.jaenData.internal.siteMetadata.siteUrl || 'https://ballons.snek.at'

const config: GatsbyConfig = {
flags: {
Expand All @@ -25,10 +18,10 @@ const config: GatsbyConfig = {
resolve: 'gatsby-plugin-react-svg',
options: {
rule: {
include: /\.inline\.svg$/,
},
include: /\.inline\.svg$/
}
}
},
},
{
resolve: '@snek-at/gatsby-theme-shopify',
options: {
Expand All @@ -45,36 +38,6 @@ const config: GatsbyConfig = {
options: {
snekResourceId: `63571eee-f41c-4745-9130-d746c2cb97a3`
}
},
{
resolve: `gatsby-plugin-sitemap`,
options: {
excludes: [`/admin`, `/admin/login`],
query: `
{
allSitePage {
nodes {
path
}
}
}`,
resolveSiteUrl: () => siteUrl,
resolvePages: ({
allSitePage: {nodes: allPages}
}: {
allSitePage: {nodes: IJaenPage[]}
}) => {
return allPages.map(page => {
return {...page}
})
},
serialize: ({path, modifiedGmt}: any) => {
return {
url: path,
lastmod: modifiedGmt
}
}
}
}
]
}
Expand Down
39 changes: 0 additions & 39 deletions gatsby-ssr.tsx

This file was deleted.

205 changes: 0 additions & 205 deletions jaen-data/internal.json

This file was deleted.

Loading

0 comments on commit 390b71f

Please sign in to comment.