quotes

My favourite quotes. (gatsbyjs)
git clone http://git.hanabi.in/repos/quotes.git
Log | Files | Refs | README | LICENSE

commit 03080bfe4a61c2c18cd3e98b7179c4c8f489edf8
parent 89e2f9c0a32ec5673d1bc0ec29096b7247c9e9c2
Author: Agastya Chandrakant <me@hanabi.in>
Date:   Wed,  4 Mar 2020 23:43:03 +0530

/post => /quote

Diffstat:
Mgatsby-node.js | 2+-
Msrc/components/header.js | 4++--
Msrc/components/seo.js | 4++--
Msrc/pages/index.js | 2+-
Dsrc/pages/post.js | 64----------------------------------------------------------------
Asrc/pages/quote.js | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/pages/random.js | 2+-
Msrc/templates/singleAuthorTemplate.js | 2+-
Msrc/templates/singleTagTemplate.js | 2+-
9 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/gatsby-node.js b/gatsby-node.js @@ -113,7 +113,7 @@ exports.createPages = function({ graphql, actions }) { createAuthorPages(createPage, posts); posts.forEach(function({ node }, index) { createPage({ - path: 'post' + node.frontmatter.path, + path: 'quote' + node.frontmatter.path, component: blogPostTemplate, context: { pathSlug: node.frontmatter.path, diff --git a/src/components/header.js b/src/components/header.js @@ -15,10 +15,10 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { > <ul className="main-menu"> <li> - {slug == 'post' ? ( + {slug == 'quote' ? ( <BoldEntry text="Quotes" /> ) : ( - <Link to="/post">Quotes</Link> + <Link to="/quote">Quotes</Link> )} </li> <li> diff --git a/src/components/seo.js b/src/components/seo.js @@ -47,7 +47,7 @@ function SEO({ blog = false, description, lang, path, tags, title }) { {blog && path ? ( <meta property="og:url" - content={`${site.siteMetadata.siteUrl}/post${path}`} + content={`${site.siteMetadata.siteUrl}/quote${path}`} /> ) : ( <meta property="og:url" content={`${site.siteMetadata.siteUrl}`} /> @@ -62,7 +62,7 @@ function SEO({ blog = false, description, lang, path, tags, title }) { {path ? ( <meta name="twitter:url" - content={`${site.siteMetadata.siteUrl}/post${path}`} + content={`${site.siteMetadata.siteUrl}/quote${path}`} /> ) : ( <meta name="twitter:url" content={`${site.siteMetadata.siteUrl}`} /> diff --git a/src/pages/index.js b/src/pages/index.js @@ -31,7 +31,7 @@ function IndexPage({ data }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={'/post/' + path}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/pages/post.js b/src/pages/post.js @@ -1,64 +0,0 @@ -import React from 'react'; -import { Link, graphql } from 'gatsby'; -import Layout from '../components/layout'; -import SEO from '../components/seo'; - -function Blog({ data }) { - const { edges } = data.allMarkdownRemark; - return ( - <Layout heading="Quotes" slug="post"> - <SEO title="Quotes" /> - <div className="home-sections-container"> - <div className="home-sections"> - <section id="recent-posts" className="home-section"> - <div className="list-container"> - <ul className="list"> - {edges.map(edge => { - const { author, path, title } = edge.node.frontmatter; - return ( - <li className="list-item" key={path}> - <article> - <div className="meta"> - <span> - <span className="screen-reader">Quote by </span> - <Link to={`/authors/${author}`}>{author}</Link> - </span> - </div> - <header className="list-item-header"> - <h3 className="list-item-title"> - <Link to={'/post/' + path}>{title}</Link> - </h3> - </header> - </article> - </li> - ); - })} - </ul> - </div> - </section> - </div> - </div> - </Layout> - ); -} - -export const query = graphql` - query { - allMarkdownRemark( - sort: { order: DESC, fields: [frontmatter___date] } - filter: { frontmatter: { draft: { ne: true } } } - ) { - edges { - node { - frontmatter { - author - path - title - } - } - } - } - } -`; - -export default Blog; diff --git a/src/pages/quote.js b/src/pages/quote.js @@ -0,0 +1,64 @@ +import React from 'react'; +import { Link, graphql } from 'gatsby'; +import Layout from '../components/layout'; +import SEO from '../components/seo'; + +function Blog({ data }) { + const { edges } = data.allMarkdownRemark; + return ( + <Layout heading="Quotes" slug="quote"> + <SEO title="Quotes" /> + <div className="home-sections-container"> + <div className="home-sections"> + <section id="recent-posts" className="home-section"> + <div className="list-container"> + <ul className="list"> + {edges.map(edge => { + const { author, path, title } = edge.node.frontmatter; + return ( + <li className="list-item" key={path}> + <article> + <div className="meta"> + <span> + <span className="screen-reader">Quote by </span> + <Link to={`/authors/${author}`}>{author}</Link> + </span> + </div> + <header className="list-item-header"> + <h3 className="list-item-title"> + <Link to={`/quote/${path}`}>{title}</Link> + </h3> + </header> + </article> + </li> + ); + })} + </ul> + </div> + </section> + </div> + </div> + </Layout> + ); +} + +export const query = graphql` + query { + allMarkdownRemark( + sort: { order: DESC, fields: [frontmatter___date] } + filter: { frontmatter: { draft: { ne: true } } } + ) { + edges { + node { + frontmatter { + author + path + title + } + } + } + } + } +`; + +export default Blog; diff --git a/src/pages/random.js b/src/pages/random.js @@ -23,7 +23,7 @@ function RandomQuotePage({ data }) { <header className="list-item-header"> <h3 className="list-item-title"> <em> - <Link to={'/post/' + path}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </em> </h3> <div className="meta"> diff --git a/src/templates/singleAuthorTemplate.js b/src/templates/singleAuthorTemplate.js @@ -25,7 +25,7 @@ function SingleAuthorTemplate({ pageContext }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/post/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/templates/singleTagTemplate.js b/src/templates/singleTagTemplate.js @@ -25,7 +25,7 @@ function SingleTagTemplate({ pageContext }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/post/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article>