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(`
{
allMdx(
limit: 1000
) {
allMdx(limit: 1000) {
edges {
node {
frontmatter {
path
title
edit {
relativePath
}
}
}
}

View File

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