generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding back About/ Export via MDX pages (#170)
* Adding back basic pages * Merge fix * Fix TS error * Run build before commit
- Loading branch information
Kendra Gibbons
authored
Jan 7, 2022
1 parent
161a42f
commit 2056cfe
Showing
9 changed files
with
675 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
. "$(dirname "$0")/_/husky.sh" | ||
yarn lint | ||
yarn test | ||
yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
const withMDX = require('@next/mdx')({ | ||
extension: /\.mdx?$/, | ||
options: { | ||
remarkPlugins: [], | ||
rehypePlugins: [], | ||
}, | ||
}) | ||
module.exports = withMDX({ | ||
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react' | ||
import { MDXProvider } from '@mdx-js/react' | ||
import Layout from './layout' | ||
import SEOTags from './SeoTags' | ||
|
||
export const Header = (props): JSX.Element => ( | ||
<header {...props}> | ||
<h1 className='text-4xl font-bold font-sans tracking-tight my-4'>{props.text}</h1> | ||
</header> | ||
) | ||
/** | ||
* <h1> short code to be used in templates | ||
*/ | ||
export const h1 = (props): JSX.Element => ( | ||
<h1 {...props} className='md-h1' /> | ||
) | ||
|
||
export const h2 = (props): JSX.Element => ( | ||
<h2 {...props} className='md-h2' /> | ||
) | ||
|
||
export const p = (props): JSX.Element => <p {...props} className='md-p' /> | ||
|
||
export const a = (props): JSX.Element => <a {...props} className='underline' /> | ||
|
||
export const ul = (props): JSX.Element => ( | ||
<ul {...props} className='list-inside list-disc' /> | ||
) | ||
|
||
export const ol = (props): JSX.Element => ( | ||
<ol {...props} className='list-inside list-decimal' /> | ||
) | ||
|
||
export const blockquote = (props): JSX.Element => (<blockquote {...props} className='border-l-4 border-gray-200 pl-6 my-6' />) | ||
|
||
export const pre = (props): JSX.Element => (<pre {...props} className='font-mono text-sm rounded-xl bg-yellow-50 p-4' />) | ||
|
||
const shortcodes = { Header, h1, h2, p, a, ol, ul, pre, blockquote } | ||
export default ({ meta, children }): JSX.Element => { | ||
const { title, keywords } = meta | ||
return ( | ||
<Layout> | ||
<> | ||
<SEOTags keywords={keywords} title={title} /> | ||
<MDXProvider components={shortcodes}> | ||
<div className='markdown mt-8'> | ||
{children} | ||
</div> | ||
</MDXProvider> | ||
</> | ||
</Layout> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react' | ||
import Header from './header' | ||
import Head from 'next/head' | ||
import SeoTags from '../components/SeoTags' | ||
|
||
interface LayoutProps { | ||
layoutClz?: string | ||
customClz?: string | ||
children?: JSX.Element | JSX.Element[] | ||
headerImage?: JSX.Element | ||
} | ||
function Layout ({ layoutClz = 'layout-default', customClz = '', children, headerImage }: LayoutProps): JSX.Element { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Climbing Route Catalog</title> | ||
<meta name='description' content='Open license climbing route catalog' /> | ||
<link rel='icon' href='/favicon.ico' /> | ||
<link | ||
href='/fonts/fonts.css' | ||
rel='stylesheet' | ||
/> | ||
<SeoTags | ||
keywords={['openbeta', 'rock climbing', 'climbing api']} | ||
description='Climbing route catalog' | ||
title='Home' | ||
/> | ||
</Head> | ||
|
||
<div className={`main-container ${customClz}`}> | ||
<Header /> | ||
|
||
{headerImage !== undefined && headerImage} | ||
|
||
<main className={layoutClz}>{children}</main> | ||
|
||
<footer className='mt-8 bg-custom-green'> | ||
<nav className='flex justify-between max-w-4xl p-4 mx-auto text-sm md:p-8'> | ||
<p className='text-white'> | ||
A project by {' '} | ||
<a | ||
className='font-bold no-underline' | ||
href='https://openbeta.io' | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
> | ||
OpenBeta | ||
</a> | ||
</p> | ||
|
||
<p> | ||
<a | ||
className='font-bold text-white no-underline' | ||
href='https://github.com/OpenBeta/open-tacos' | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
> | ||
GitHub | ||
</a> | ||
</p> | ||
</nav> | ||
</footer> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default Layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
2056cfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: