commit 63f881bfebaed9292780d7b5ae68a6017005a885
parent 184927fc5b4f418398156178996f0de2f5a79d21
Author: Agastya Chandrakant <me@hanabi.in>
Date: Mon, 16 Nov 2020 18:55:08 +0530
formatting + add <abbr> for symbols
Diffstat:
8 files changed, 61 insertions(+), 23 deletions(-)
diff --git a/src/components/header.js b/src/components/header.js
@@ -6,7 +6,13 @@ import React from 'react';
import { siteMetadata } from '../../gatsby-config';
const { repo } = siteMetadata;
-function Header({ description, link = `/${repo}`, 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 +26,15 @@ function Header({ description, link = `/${repo}`, showHeader, siteTitle, slug })
{slug == 'quote' ? (
<BoldEntry text="Quotes" />
) : (
- <Link to={`/${repo}`}>Quotes</Link>
- )}
+ <Link to={`/${repo}`}>Quotes</Link>
+ )}
</li>
<li>
{slug == 'about' ? (
<BoldEntry text="About" />
) : (
- <Link to={`/${repo}/about`}>About</Link>
- )}
+ <Link to={`/${repo}/about`}>About</Link>
+ )}
</li>
</ul>
</nav>
diff --git a/src/components/seo.js b/src/components/seo.js
@@ -11,7 +11,15 @@ import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { useStaticQuery, graphql } from 'gatsby';
-function SEO({ blog = false, cover = 'https://upload.wikimedia.org/wikipedia/commons/6/68/Das_große_Q.jpg', description, lang, path, tags, title }) {
+function SEO({
+ blog = false,
+ cover = 'https://upload.wikimedia.org/wikipedia/commons/6/68/Das_große_Q.jpg',
+ description,
+ lang,
+ path,
+ tags,
+ title,
+}) {
const { site } = useStaticQuery(
graphql`
query {
@@ -51,8 +59,8 @@ function SEO({ blog = false, cover = 'https://upload.wikimedia.org/wikipedia/com
content={`${site.siteMetadata.siteUrl}/quote${path}`}
/>
) : (
- <meta property="og:url" content={`${site.siteMetadata.siteUrl}`} />
- )}
+ <meta property="og:url" content={`${site.siteMetadata.siteUrl}`} />
+ )}
{blog &&
tags.length &&
tags.map(tag => (
@@ -66,8 +74,8 @@ function SEO({ blog = false, cover = 'https://upload.wikimedia.org/wikipedia/com
content={`${site.siteMetadata.siteUrl}/quote${path}`}
/>
) : (
- <meta name="twitter:url" content={`${site.siteMetadata.siteUrl}`} />
- )}
+ <meta name="twitter:url" content={`${site.siteMetadata.siteUrl}`} />
+ )}
{blog && <meta name="twitter:label1" content="Written by" />}
{blog && <meta name="twitter:data1" content={site.siteMetadata.author} />}
{blog && tags.length && (
diff --git a/src/pages/index.js b/src/pages/index.js
@@ -35,25 +35,33 @@ function IndexPage({ data }) {
<span>
<span className="screen-reader">Quote by </span>
<span>
- <Link to={`${repo}/authors/${author}`}>{author}</Link>
+ <Link to={`${repo}/authors/${author}`}>
+ {author}
+ </Link>
{attributed ? (
<span>
<sup>
- <em>!</em>
+ <em>
+ <abbr title="Attributed">!</abbr>
+ </em>
</sup>
</span>
) : null}
{misattributed ? (
<span>
<sup>
- <em>?</em>
+ <em>
+ <abbr title="Misattributed">?</abbr>
+ </em>
</sup>
</span>
) : null}
{unverified ? (
<span>
<sup>
- <em>#</em>
+ <em>
+ <abbr title="Unverified">#</abbr>
+ </em>
</sup>
</span>
) : null}
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 (
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 (
diff --git a/src/templates/blogPost.js b/src/templates/blogPost.js
@@ -98,21 +98,27 @@ function Footer({ attributed, author, misattributed, tags, unverified }) {
{attributed ? (
<span>
<sup>
- <em>!</em>
+ <em>
+ <abbr title="Attributed">!</abbr>
+ </em>
</sup>
</span>
) : null}
{misattributed ? (
<span>
<sup>
- <em>?</em>
+ <em>
+ <abbr title="Misattributed">?</abbr>
+ </em>
</sup>
</span>
) : null}
{unverified ? (
<span>
<sup>
- <em>#</em>
+ <em>
+ <abbr title="Unverified">#</abbr>
+ </em>
</sup>
</span>
) : null}
diff --git a/src/templates/singleAuthorTemplate.js b/src/templates/singleAuthorTemplate.js
@@ -37,21 +37,27 @@ function SingleAuthorTemplate({ pageContext }) {
{attributed ? (
<span>
<sup>
- <em>!</em>
+ <em>
+ <abbr title="Attributed">!</abbr>
+ </em>
</sup>
</span>
) : null}
{misattributed ? (
<span>
<sup>
- <em>?</em>
+ <em>
+ <abbr title="Misattributed">?</abbr>
+ </em>
</sup>
</span>
) : null}
{unverified ? (
<span>
<sup>
- <em>#</em>
+ <em>
+ <abbr title="Unverified">#</abbr>
+ </em>
</sup>
</span>
) : null}
diff --git a/src/templates/singleTagTemplate.js b/src/templates/singleTagTemplate.js
@@ -9,7 +9,11 @@ const { repo } = siteMetadata;
function SingleTagTemplate({ pageContext }) {
const { posts, tag } = pageContext;
return (
- <Layout heading={`Tag: ${tag} (${posts.length})`} link={`/${repo}/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">