change edit link loading

This commit is contained in:
neri 2019-12-14 18:03:07 +01:00
parent d52c589ed6
commit de1dff70f1
2 changed files with 8 additions and 5 deletions

View File

@ -7,14 +7,15 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
const result = await graphql(` const result = await graphql(`
{ {
allMdx( allMdx(limit: 1000) {
limit: 1000
) {
edges { edges {
node { node {
frontmatter { frontmatter {
path path
title title
edit {
relativePath
}
} }
} }
} }

View File

@ -16,7 +16,7 @@ export default function Template({
document.title = frontmatter.title document.title = frontmatter.title
}, [frontmatter.title]) }, [frontmatter.title])
const editLink = frontmatter.edit ? ide + frontmatter.edit : null const editLink = frontmatter.edit ? ide + frontmatter.edit.relativePath : null
return ( return (
<Layout editLink={editLink}> <Layout editLink={editLink}>
@ -31,7 +31,9 @@ export const pageQuery = graphql`
body body
frontmatter { frontmatter {
title title
edit edit {
relativePath
}
} }
} }
} }