quotes

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

commit eded1289191d0d9bb7a89668a0debc3f4c3b5ae5
parent f9ebe0e74b3afb0759d32e04a1fff25720ef2fd6
Author: Agastya Chandrakant <acagastya@outlook.com>
Date:   Sun, 19 Jul 2020 05:40:23 +0530

reverting to the hacky way of handling /quotes, #1 is not fixed

Diffstat:
Mgatsby-config.js | 1-
Mpackage.json | 5+++--
Msrc/components/header.js | 12++++++------
Msrc/pages/index.js | 4++--
Msrc/pages/quote.js | 4++--
Msrc/templates/allAuthorsTemplate.js | 4++--
Msrc/templates/allTagsTemplate.js | 4++--
Msrc/templates/blogPost.js | 4++--
Msrc/templates/singleAuthorTemplate.js | 6+++---
Msrc/templates/singleTagTemplate.js | 6+++---
10 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/gatsby-config.js b/gatsby-config.js @@ -1,6 +1,5 @@ const path = require('path'); module.exports = { - pathPrefix: 'quotes', siteMetadata: { author: 'Agastya Chandrakant', description: 'Some of my favourite quotes', diff --git a/package.json b/package.json @@ -42,7 +42,7 @@ "scripts": { "build": "gatsby clean && gatsby build", "clean": "gatsby clean", - "deploy": "gatsby clean && gatsby build --prefix-paths && gh-pages -d public", + "deploy": "gatsby clean && gatsby build && gh-pages -d public", "develop": "gatsby clean && gatsby develop", "format": "prettier --write \"**/*.{js,jsx,json,md}\"", "ps": "gatsby clean && gatsby build && gatsby serve", @@ -51,4 +51,4 @@ "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" }, "version": "0.0.1" -} +} +\ No newline at end of file diff --git a/src/components/header.js b/src/components/header.js @@ -6,7 +6,7 @@ import React from 'react'; import { siteMetadata } from '../../gatsby-config'; const { repo } = siteMetadata; -function Header({ description, link = '/', showHeader, siteTitle, slug }) { +function Header({ description, link = `/${repo}`, showHeader, siteTitle, slug }) { return ( <header id="header" className="header-container"> <div className="header site-header"> @@ -20,15 +20,15 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { {slug == 'quote' ? ( <BoldEntry text="Quotes" /> ) : ( - <Link to="/quote">Quotes</Link> - )} + <Link to={`/${repo}/quote`}>Quotes</Link> + )} </li> <li> {slug == 'about' ? ( <BoldEntry text="About" /> ) : ( - <Link to="/about">About</Link> - )} + <Link to={`/${repo}/about`}>About</Link> + )} </li> </ul> </nav> @@ -36,7 +36,7 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { {showHeader && ( <div className="header-info"> <p className="site-title title"> - <Link to={`/${link}/`}>{siteTitle}</Link> + <Link to={link}>{siteTitle}</Link> </p> {siteTitle == 'Quotes' && ( <p className="site-description subtitle">{description}</p> diff --git a/src/pages/index.js b/src/pages/index.js @@ -35,7 +35,7 @@ function IndexPage({ data }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`/authors/${author}`}>{author}</Link> + <Link to={`${repo}/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -62,7 +62,7 @@ function IndexPage({ data }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/quote/${path}`}>{title}</Link> + <Link to={`${repo}/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/pages/quote.js b/src/pages/quote.js @@ -31,7 +31,7 @@ function Blog({ data }) { <div className="meta"> <span> <span className="screen-reader">Quote by </span> - <Link to={`/authors/${author}`}>{author}</Link> + <Link to={`${repo}/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -57,7 +57,7 @@ function Blog({ data }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/quote/${path}`}>{title}</Link> + <Link to={`${repo}/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/templates/allAuthorsTemplate.js b/src/templates/allAuthorsTemplate.js @@ -10,7 +10,7 @@ function AllAuthorsTemplate({ pageContext }) { const { authors, postsByAuthor } = pageContext; const count = Object.values(postsByAuthor).map(el => el.length); const [max, min] = [Math.max(...count), Math.min(...count)]; - authors.sort(function(str1, str2) { + authors.sort(function (str1, str2) { return str1.toLowerCase().localeCompare(str2.toLowerCase()); }); return ( @@ -26,7 +26,7 @@ function AllAuthorsTemplate({ pageContext }) { return ( <li key={author}> <Link - to={`/authors/${author}`} + to={`/${repo}/authors/${author}`} style={{ fontSize: `${1 + num}em`, fontWeight: `${weight}` }} > {author} diff --git a/src/templates/allTagsTemplate.js b/src/templates/allTagsTemplate.js @@ -10,7 +10,7 @@ function AllTagsTemplate({ pageContext }) { const { postsByTag, tags } = pageContext; const count = Object.values(postsByTag).map(el => el.length); const [max, min] = [Math.max(...count), Math.min(...count)]; - tags.sort(function(str1, str2) { + tags.sort(function (str1, str2) { return str1.toLowerCase().localeCompare(str2.toLowerCase()); }); return ( @@ -26,7 +26,7 @@ function AllTagsTemplate({ pageContext }) { return ( <li key={tag}> <Link - to={`/tags/${tag}`} + to={`/${repo}/tags/${tag}`} style={{ fontSize: `${1 + num}em`, fontWeight: `${weight}` }} > {tag} diff --git a/src/templates/blogPost.js b/src/templates/blogPost.js @@ -90,7 +90,7 @@ function Footer({ attributed, author, misattributed, tags, unverified }) { <CategorySVG /> </span> <span className="screen-reader">Author: </span> - <Link className="author" to={`/authors/${author}`}> + <Link className="author" to={`/${repo}/authors/${author}`}> {author} </Link> {attributed ? ( @@ -124,7 +124,7 @@ function Footer({ attributed, author, misattributed, tags, unverified }) { {tags.map((tag, index) => { return ( <React.Fragment key={tag}> - <Link className="tag" to={`/tags/${tag}`}> + <Link className="tag" to={`/${repo}/tags/${tag}`}> {tag} </Link> {index < tags.length - 1 ? ', ' : ' '} diff --git a/src/templates/singleAuthorTemplate.js b/src/templates/singleAuthorTemplate.js @@ -11,7 +11,7 @@ function SingleAuthorTemplate({ pageContext }) { return ( <Layout heading={`Author: ${author} (${posts.length})`} - link="/authors" + link={`/${repo}/authors`} slug="authors" > <SEO title={`Author: ${author}`} /> @@ -33,7 +33,7 @@ function SingleAuthorTemplate({ pageContext }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`/authors/${author}`}>{author}</Link> + <Link to={`/${repo}/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -60,7 +60,7 @@ function SingleAuthorTemplate({ pageContext }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/quote/${path}`}>{title}</Link> + <Link to={`/${repo}/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/templates/singleTagTemplate.js b/src/templates/singleTagTemplate.js @@ -9,7 +9,7 @@ const { repo } = siteMetadata; function SingleTagTemplate({ pageContext }) { const { posts, tag } = pageContext; return ( - <Layout heading={`Tag: ${tag} (${posts.length})`} link="/tags" slug="tag"> + <Layout heading={`Tag: ${tag} (${posts.length})`} link={`/${repo}/tags`} slug="tag"> <SEO title={`Tag: ${tag}`} /> <div className="list-container"> <ul className="list"> @@ -29,7 +29,7 @@ function SingleTagTemplate({ pageContext }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`/authors/${author}`}>{author}</Link> + <Link to={`/${repo}/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -56,7 +56,7 @@ function SingleTagTemplate({ pageContext }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`/quote/${path}`}>{title}</Link> + <Link to={`/${repo}/quote/${path}`}>{title}</Link> </h3> </header> </article>