commit 0b0ac6f1af087fc1d88015921ced36fab3f8cb90
parent f8779c50c63fe451b96f6610cc3bd49b8bf8ea40
Author: Agastya Chandrakant <me@hanabi.in>
Date: Wed, 11 Mar 2020 14:10:37 +0530
add support for unverified
Diffstat:
6 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/src/pages/index.js b/src/pages/index.js
@@ -23,6 +23,7 @@ function IndexPage({ data }) {
misattributed,
path,
title,
+ unverified,
} = edge.node.frontmatter;
return (
<li className="list-item" key={path}>
@@ -46,6 +47,13 @@ function IndexPage({ data }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
</span>
</span>
</div>
@@ -81,6 +89,7 @@ export const query = graphql`
misattributed
path
title
+ unverified
}
}
}
diff --git a/src/pages/quote.js b/src/pages/quote.js
@@ -20,6 +20,7 @@ function Blog({ data }) {
misattributed,
path,
title,
+ unverified,
} = edge.node.frontmatter;
return (
<li className="list-item" key={path}>
@@ -42,6 +43,13 @@ function Blog({ data }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
</span>
</div>
<header className="list-item-header">
@@ -76,6 +84,7 @@ export const query = graphql`
misattributed
path
title
+ unverified
}
}
}
diff --git a/src/pages/random.js b/src/pages/random.js
@@ -6,9 +6,15 @@ import SEO from '../components/seo';
function RandomQuotePage({ data }) {
const { edges } = data.allMarkdownRemark;
const rnd = Math.floor(Math.random() * edges.length);
- const { attributed, author, misattributed, path, title, where } = edges[
- rnd
- ].node.frontmatter;
+ const {
+ attributed,
+ author,
+ misattributed,
+ path,
+ title,
+ unverified,
+ where,
+ } = edges[rnd].node.frontmatter;
return (
<Layout>
@@ -52,6 +58,13 @@ function RandomQuotePage({ data }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
{where ? (
<span>
<em>, {where}</em>
@@ -85,6 +98,7 @@ export const query = graphql`
misattributed
path
title
+ unverified
where
}
}
diff --git a/src/templates/blogPost.js b/src/templates/blogPost.js
@@ -15,6 +15,7 @@ function Template({ data }) {
path,
tags,
title,
+ unverified,
} = frontmatter;
return (
<Layout showHeader={false} heading={title}>
@@ -27,6 +28,7 @@ function Template({ data }) {
misattributed={misattributed}
tags={tags}
title={title}
+ unverified={unverified}
/>
</Layout>
);
@@ -44,12 +46,21 @@ export const query = graphql`
path
tags
title
+ unverified
}
}
}
`;
-function Article({ attributed, author, html, lang, misattributed, tags }) {
+function Article({
+ attributed,
+ author,
+ html,
+ lang,
+ misattributed,
+ tags,
+ unverified,
+}) {
return (
<article lang={lang} className="entry">
<div
@@ -61,12 +72,13 @@ function Article({ attributed, author, html, lang, misattributed, tags }) {
author={author}
misattributed={misattributed}
tags={tags}
+ unverified={unverified}
/>
</article>
);
}
-function Footer({ attributed, author, misattributed, tags }) {
+function Footer({ attributed, author, misattributed, tags, unverified }) {
return (
<footer className="entry-footer-container">
<div className="entry-footer">
@@ -92,6 +104,13 @@ function Footer({ attributed, author, misattributed, tags }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
</div>
{tags.length ? (
<div className="tags">
diff --git a/src/templates/singleAuthorTemplate.js b/src/templates/singleAuthorTemplate.js
@@ -21,6 +21,7 @@ function SingleAuthorTemplate({ pageContext }) {
misattributed,
path,
title,
+ unverified,
} = post.frontmatter;
return (
<li key={path} className="list-item">
@@ -44,6 +45,13 @@ function SingleAuthorTemplate({ pageContext }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
</span>
</span>
</div>
diff --git a/src/templates/singleTagTemplate.js b/src/templates/singleTagTemplate.js
@@ -17,6 +17,7 @@ function SingleTagTemplate({ pageContext }) {
misattributed,
path,
title,
+ unverified,
} = post.frontmatter;
return (
<li key={path} className="list-item">
@@ -40,6 +41,13 @@ function SingleTagTemplate({ pageContext }) {
</sup>
</span>
) : null}
+ {unverified ? (
+ <span>
+ <sup>
+ <em>#</em>
+ </sup>
+ </span>
+ ) : null}
</span>
</span>
</div>