begin blog implementation
This commit is contained in:
parent
7e6cbc9b29
commit
1c779d2110
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: Test Entry
|
||||
date: '1970-01-01T22:45:00-01:00'
|
||||
description: 'testing the log posts'
|
||||
---
|
||||
|
||||
# This is a test
|
|
@ -14,6 +14,13 @@ module.exports = {
|
|||
path: `${__dirname}/src/pages`,
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: `gatsby-source-filesystem`,
|
||||
options: {
|
||||
name: `blog`,
|
||||
path: `${__dirname}/blog`,
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: `gatsby-plugin-mdx`,
|
||||
options: {
|
||||
|
|
|
@ -7,7 +7,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
|
||||
const result = await graphql(`
|
||||
{
|
||||
allMdx(limit: 1000) {
|
||||
allMdx(limit: 1000, filter: { fields: { source: { eq: "pages" } } }) {
|
||||
edges {
|
||||
node {
|
||||
frontmatter {
|
||||
|
@ -36,11 +36,24 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
})
|
||||
}
|
||||
|
||||
exports.onCreateNode = ({ node, getNode, actions }) => {
|
||||
const { createNodeField } = actions
|
||||
|
||||
if (node.internal.type === `Mdx`) {
|
||||
const value = getNode(node.parent).sourceInstanceName
|
||||
createNodeField({
|
||||
node,
|
||||
name: `source`,
|
||||
value,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
exports.createSchemaCustomization = ({ actions }) => {
|
||||
const { createTypes } = actions
|
||||
const typeDefs = `
|
||||
type Mdx implements Node {
|
||||
frontmatter: Frontmatter
|
||||
frontmatter: Frontmatter
|
||||
}
|
||||
|
||||
type Frontmatter {
|
||||
|
|
Loading…
Reference in New Issue