change edit link loading
This commit is contained in:
parent
d52c589ed6
commit
de1dff70f1
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue