X7ROOT File Manager
Current Path:
/opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/docs
opt
/
alt
/
alt-nodejs12
/
root
/
usr
/
lib
/
node_modules
/
npm
/
docs
/
📁
..
📄
LICENSE
(1.05 KB)
📁
content
📄
gatsby-browser.js
(250 B)
📄
gatsby-config.js
(2.62 KB)
📄
gatsby-node.js
(974 B)
📄
gatsby-ssr.js
(179 B)
📄
package-lock.json
(716.78 KB)
📄
package.json
(1.39 KB)
📁
public
📁
src
Editing: gatsby-node.js
const {createFilePath} = require('gatsby-source-filesystem') const path = require('path') exports.onCreateNode = ({node, getNode, actions}) => { const {createNodeField} = actions if (node.internal.type === 'MarkdownRemark') { const slug = createFilePath({node, getNode, basePath: 'content', trailingSlash: false}) createNodeField({ node, name: 'slug', value: slug }) } } exports.createPages = ({graphql, actions}) => { const {createPage} = actions return graphql(` { allMarkdownRemark { edges { node { id fields { slug } html } } } } `).then(result => { result.data.allMarkdownRemark.edges.forEach(({node}) => { createPage({ path: node.fields.slug, component: path.resolve('./src/templates/Page.js'), context: { slug: node.fields.slug } }) }) }) }
Upload File
Create Folder