update to gatsby 3

master
Edward Shen 2021-05-01 21:03:17 -04:00
parent 42d8064cab
commit a789504679
Signed by: edward
GPG Key ID: 19182661E818369F
5 changed files with 4474 additions and 5648 deletions

View File

@ -15,18 +15,18 @@
"dependencies": { "dependencies": {
"@mdx-js/mdx": "^1.6.18", "@mdx-js/mdx": "^1.6.18",
"@mdx-js/react": "^1.6.18", "@mdx-js/react": "^1.6.18",
"gatsby": "^2.24.63", "gatsby": "^3.0.0",
"gatsby-plugin-mdx": "^1.2.41", "gatsby-plugin-mdx": "^2.4.0",
"gatsby-plugin-mdx-frontmatter": "^0.0.2", "gatsby-plugin-mdx-frontmatter": "^0.0.2",
"gatsby-plugin-react-helmet": "^3.3.11", "gatsby-plugin-react-helmet": "^4.4.0",
"gatsby-plugin-typography": "^2.5.11", "gatsby-plugin-typography": "^3.4.0",
"gatsby-remark-prismjs": "^3.5.13", "gatsby-remark-prismjs": "^5.1.0",
"gatsby-remark-smartypants": "^2.3.11", "gatsby-remark-smartypants": "^4.1.0",
"gatsby-source-filesystem": "^2.3.30", "gatsby-source-filesystem": "^3.4.0",
"gatsby-transformer-remark": "^2.8.35", "gatsby-transformer-remark": "^4.1.0",
"prismjs": "^1.21.0", "prismjs": "^1.21.0",
"react": "^16.12.0", "react": "^17.0.2",
"react-dom": "^16.12.0", "react-dom": "^17.0.2",
"react-helmet": "^6.1.0", "react-helmet": "^6.1.0",
"react-typography": "^0.16.19", "react-typography": "^0.16.19",
"typography": "^0.16.19" "typography": "^0.16.19"
@ -36,8 +36,8 @@
"@typescript-eslint/parser": "^4.2.0", "@typescript-eslint/parser": "^4.2.0",
"eslint": "^7.9.0", "eslint": "^7.9.0",
"eslint-loader": "^4.0.2", "eslint-loader": "^4.0.2",
"gatsby-plugin-eslint": "^2.0.8", "gatsby-plugin-eslint": "^3.0.0",
"prettier": "2.1.1", "prettier": "2.2.1",
"typescript": "^4.0.3" "typescript": "^4.0.3"
} }
} }

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import style from './item.module.css'; import { projectItem, projectSubtitle, projectTitle } from './item.module.css';
import { Link } from 'gatsby'; import { Link } from 'gatsby';
interface ItemProps { interface ItemProps {
@ -9,10 +9,10 @@ interface ItemProps {
} }
export default (props: ItemProps): JSX.Element => ( export default (props: ItemProps): JSX.Element => (
<article className={style.projectItem}> <article className={projectItem}>
<Link to={props.to}> <Link to={props.to}>
<h3 className={style.projectTitle}>{props.title}</h3> <h3 className={projectTitle}>{props.title}</h3>
</Link> </Link>
<p className={style.projectSubtitle}>{props.subtitle}</p> <p className={projectSubtitle}>{props.subtitle}</p>
</article> </article>
); );

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import style from './pagination.module.css'; import { prevPageLink, paginationNav, nextPageLink } from './pagination.module.css';
interface Pagination { interface Pagination {
currentPage: number; currentPage: number;
@ -12,18 +12,18 @@ export default ({
numPages, numPages,
rootPath, rootPath,
}: Pagination): JSX.Element => { }: Pagination): JSX.Element => {
let prevPageLink = null; let prevPageLinkItem = null;
if (currentPage === 2) { if (currentPage === 2) {
prevPageLink = ( prevPageLinkItem = (
<a href={rootPath} className={style.prevPageLink}> <a href={rootPath} className={prevPageLink}>
&lt;&lt; &lt;&lt;
</a> </a>
); );
} else if (currentPage !== 1) { } else if (currentPage !== 1) {
prevPageLink = ( prevPageLinkItem = (
<a <a
href={rootPath + '/' + (currentPage - 1)} href={rootPath + '/' + (currentPage - 1)}
className={style.prevPageLink} className={prevPageLink}
> >
&lt;&lt; &lt;&lt;
</a> </a>
@ -32,13 +32,13 @@ export default ({
if (numPages !== 1) { if (numPages !== 1) {
return ( return (
<p className={style.paginationNav}> <p className={paginationNav}>
{prevPageLink} {prevPageLinkItem}
{currentPage} {currentPage}
{currentPage !== numPages && ( {currentPage !== numPages && (
<a <a
href={rootPath + '/' + (currentPage + 1)} href={rootPath + '/' + (currentPage + 1)}
className={style.nextPageLink} className={nextPageLink}
> >
&gt;&gt; &gt;&gt;
</a> </a>

View File

@ -7,7 +7,7 @@ import Navbar from '../components/navbar';
import PaginationNav from '../components/pagination'; import PaginationNav from '../components/pagination';
import React from 'react'; import React from 'react';
import { graphql } from 'gatsby'; import { graphql } from 'gatsby';
import style from './notes.module.css'; import { noteTitle } from './notes.module.css';
export default ({ data, pageContext }): JSX.Element => { export default ({ data, pageContext }): JSX.Element => {
const posts = data.allMdx.edges; const posts = data.allMdx.edges;
@ -20,7 +20,7 @@ export default ({ data, pageContext }): JSX.Element => {
const frontmatter = node.frontmatter; const frontmatter = node.frontmatter;
return ( return (
<article key={frontmatter.title}> <article key={frontmatter.title}>
<div className={style.noteTitle}> <div className={noteTitle}>
<h3> <h3>
<a href={`${rootPath + '/' + frontmatter.path}`}> <a href={`${rootPath + '/' + frontmatter.path}`}>
{frontmatter.title} {frontmatter.title}

10068
yarn.lock

File diff suppressed because it is too large Load Diff