@@ -16,11 +23,11 @@ export default function Home({ data }) {
{post.frontmatter.formattedDate}, {post.frontmatter.fromNowDate}
diff --git a/src/templates/category.js b/src/templates/category.js
new file mode 100644
index 0000000..25505be
--- /dev/null
+++ b/src/templates/category.js
@@ -0,0 +1,50 @@
+import React from "react";
+import { graphql } from "gatsby";
+import Page from "./page";
+
+export default function Category({ data, pageContext }) {
+ var { category } = pageContext;
+ var siteMetadata = data.site.siteMetadata;
+ var totalCount = data.allMarkdownRemark.totalCount;
+ var postListItems = data.allMarkdownRemark.edges.map(function(edge) {
+ return (
+ {edge.node.frontmatter.title}
+ );
+ });
+
+ return (
+
+
+ All posts categorized under "{category}".
+
+
+
+ )
+}
+
+export const query = graphql`
+ query($category: String!) {
+ allMarkdownRemark(
+ sort: { fields: [frontmatter___date], order: DESC }
+ filter: { frontmatter: { categories: { in: [$category] } } }
+ )
+ {
+ totalCount
+ edges {
+ node {
+ fields {
+ slug
+ }
+ frontmatter {
+ title
+ }
+ }
+ }
+ }
+ site {
+ ...HeaderInfo
+ }
+ }
+`
\ No newline at end of file
diff --git a/src/templates/post.js b/src/templates/post.js
index 2d4fda3..7b6ee3c 100644
--- a/src/templates/post.js
+++ b/src/templates/post.js
@@ -11,7 +11,7 @@ export default function Post({ data }) {
return (#{tag});
});
var categories = post.frontmatter.categories.map((category) => {
- return (#{category});
+ return ({category});
});
return (
@@ -37,7 +37,7 @@ export default function Post({ data }) {
shortname='fishybusiness'
config={
{
- url: "https://www.benramey.com" + data.sitePage.path,
+ url: "https://www.benramey.com" + post.slug,
identifier: post.slug,
title: post.frontmatter.title,
language: 'en_US'
diff --git a/src/templates/tag.js b/src/templates/tag.js
index 14917b2..1ba0a36 100644
--- a/src/templates/tag.js
+++ b/src/templates/tag.js
@@ -15,7 +15,7 @@ export default function Tag({ data, pageContext }) {
return (
- All posts tagged with "{tag}";
+ All posts tagged with "{tag}".