quotes

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

commit e53749360c07ff7ea6989bfd242b41e1f92b6eb1
parent 0f6323189ae8eac2c2336b823e97193040772d1b
Author: Agastya Chandrakant <me@hanabi.in>
Date:   Wed, 11 Mar 2020 20:54:20 +0530

Drop support for random, happens at build time

Diffstat:
Msrc/components/header.js | 15---------------
Dsrc/pages/random.js | 110-------------------------------------------------------------------------------
2 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/src/components/header.js b/src/components/header.js @@ -30,13 +30,6 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { <Link to={`/${repo}/about`}>About</Link> )} </li> - <li> - {slug == 'random' ? ( - <BoldLinkEntry text="Random" path={`/${repo}/random/`} /> - ) : ( - <Link to={`/${repo}/random`}>Random</Link> - )} - </li> </ul> </nav> @@ -67,12 +60,4 @@ function BoldEntry({ text = '' }) { return <span style={{ fontWeight: 700, cursor: 'default' }}>{text}</span>; } -function BoldLinkEntry({ text = '', path = `/${repo}` }) { - return ( - <span style={{ fontWeight: 700, cursor: 'default' }}> - <Link to={path}>{text}</Link> - </span> - ); -} - export default Header; diff --git a/src/pages/random.js b/src/pages/random.js @@ -1,110 +0,0 @@ -import React from 'react'; -import { Link, graphql } from 'gatsby'; -import Layout from '../components/layout'; -import SEO from '../components/seo'; -import { siteMetadata } from '../../gatsby-config'; - -const { repo } = siteMetadata; - -function RandomQuotePage({ data }) { - const { edges } = data.allMarkdownRemark; - const rnd = Math.floor(Math.random() * edges.length); - const { - attributed, - author, - misattributed, - path, - title, - unverified, - where, - } = edges[rnd].node.frontmatter; - - return ( - <Layout slug="random" heading="Random Quote"> - <SEO title="Random Quote" /> - <div className="home-sections-container"> - <div className="home-sections"> - <section id="recent-posts" className="home-section"> - <div className="list-container"> - <ul className="list"> - <article> - <header className="list-item-header"> - <h3 className="list-item-title"> - <em> - <Link to={`${repo}/quote/${path}`}>{title}</Link> - </em> - </h3> - <div className="meta"> - <span> - <span className="screen-reader">Quote by </span> - <span className="author-container"> - <Link - className="author-container-link" - to={`${repo}/authors/${author}`} - > - {author} - </Link> - {attributed ? ( - <span> - <sup> - <em>!</em> - </sup> - </span> - ) : null} - {misattributed ? ( - <span> - <sup> - <em>?</em> - </sup> - </span> - ) : null} - {unverified ? ( - <span> - <sup> - <em>#</em> - </sup> - </span> - ) : null} - {where ? ( - <span> - <em>, {where}</em> - </span> - ) : null} - </span> - </span> - </div> - </header> - </article> - </ul> - </div> - </section> - </div> - </div> - </Layout> - ); -} - -export const query = graphql` - query RandomQuoteQuery { - allMarkdownRemark( - sort: { order: DESC, fields: [frontmatter___date] } - filter: { frontmatter: { draft: { ne: true } } } - ) { - edges { - node { - frontmatter { - attributed - author - misattributed - path - title - unverified - where - } - } - } - } - } -`; - -export default RandomQuotePage;