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`,
|
path: `${__dirname}/src/pages`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resolve: `gatsby-source-filesystem`,
|
||||||
|
options: {
|
||||||
|
name: `blog`,
|
||||||
|
path: `${__dirname}/blog`,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
resolve: `gatsby-plugin-mdx`,
|
resolve: `gatsby-plugin-mdx`,
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -7,7 +7,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
||||||
|
|
||||||
const result = await graphql(`
|
const result = await graphql(`
|
||||||
{
|
{
|
||||||
allMdx(limit: 1000) {
|
allMdx(limit: 1000, filter: { fields: { source: { eq: "pages" } } }) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
frontmatter {
|
frontmatter {
|
||||||
|
@ -36,6 +36,19 @@ 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 }) => {
|
exports.createSchemaCustomization = ({ actions }) => {
|
||||||
const { createTypes } = actions
|
const { createTypes } = actions
|
||||||
const typeDefs = `
|
const typeDefs = `
|
||||||
|
|
Loading…
Reference in New Issue