quotes

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

commit c738d3c8e7b64452a82f04d2027f5a7d4500b266
parent 5702310bbe5a9b6a140e259383f299ecdb51e8f9
Author: Agastya Chandrakant <me@hanabi.in>
Date:   Tue, 19 May 2020 06:54:03 +0530

Fixes #1

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

diff --git a/gatsby-config.js b/gatsby-config.js @@ -1,5 +1,6 @@ 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 && gh-pages -d public", + "deploy": "gatsby clean && gatsby build --prefix-paths && gh-pages -d public", "develop": "gatsby clean && gatsby develop", "format": "prettier --write \"**/*.{js,jsx,json,md}\"", "ps": "gatsby clean && gatsby build && gatsby serve", diff --git a/src/components/header.js b/src/components/header.js @@ -20,14 +20,14 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { {slug == 'quote' ? ( <BoldEntry text="Quotes" /> ) : ( - <Link to={`/${repo}/quote`}>Quotes</Link> + <Link to="/quote">Quotes</Link> )} </li> <li> {slug == 'about' ? ( <BoldEntry text="About" /> ) : ( - <Link to={`/${repo}/about`}>About</Link> + <Link to="/about">About</Link> )} </li> </ul> @@ -36,7 +36,7 @@ function Header({ description, link = '/', showHeader, siteTitle, slug }) { {showHeader && ( <div className="header-info"> <p className="site-title title"> - <Link to={`/${repo}/${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,9 +35,7 @@ function IndexPage({ data }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`${repo}/authors/${author}`}> - {author} - </Link> + <Link to={`/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -64,7 +62,7 @@ function IndexPage({ data }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`${repo}/quote/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/pages/quote.js b/src/pages/quote.js @@ -31,9 +31,7 @@ function Blog({ data }) { <div className="meta"> <span> <span className="screen-reader">Quote by </span> - <Link to={`${repo}/authors/${author}`}> - {author} - </Link> + <Link to={`/authors/${author}`}>{author}</Link> {attributed ? ( <span> <sup> @@ -59,7 +57,7 @@ function Blog({ data }) { </div> <header className="list-item-header"> <h3 className="list-item-title"> - <Link to={`${repo}/quote/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/templates/allAuthorsTemplate.js b/src/templates/allAuthorsTemplate.js @@ -26,7 +26,7 @@ function AllAuthorsTemplate({ pageContext }) { return ( <li key={author}> <Link - to={`/${repo}/authors/${author}`} + to={`/authors/${author}`} style={{ fontSize: `${1 + num}em`, fontWeight: `${weight}` }} > {author} diff --git a/src/templates/allTagsTemplate.js b/src/templates/allTagsTemplate.js @@ -26,7 +26,7 @@ function AllTagsTemplate({ pageContext }) { return ( <li key={tag}> <Link - to={`/${repo}/tags/${tag}`} + to={`/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={`/${repo}/authors/${author}`}> + <Link className="author" to={`/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={`/${repo}/tags/${tag}`}> + <Link className="tag" to={`/tags/${tag}`}> {tag} </Link> {index < tags.length - 1 ? ', ' : ' '} diff --git a/src/templates/singleAuthorTemplate.js b/src/templates/singleAuthorTemplate.js @@ -33,7 +33,7 @@ function SingleAuthorTemplate({ pageContext }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`/${repo}/authors/${author}`}>{author}</Link> + <Link to={`/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={`/${repo}/quote/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article> diff --git a/src/templates/singleTagTemplate.js b/src/templates/singleTagTemplate.js @@ -29,7 +29,7 @@ function SingleTagTemplate({ pageContext }) { <span> <span className="screen-reader">Quote by </span> <span> - <Link to={`/${repo}/authors/${author}`}>{author}</Link> + <Link to={`/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={`/${repo}/quote/${path}`}>{title}</Link> + <Link to={`/quote/${path}`}>{title}</Link> </h3> </header> </article>