PATH: //proc/thread-self/root/opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/docs
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 LICENSE
↓
X
📁 content/
X
📄 gatsby-browser.js
↓
X
📄 gatsby-config.js
↓
X
📄 gatsby-node.js
↓
X
📄 gatsby-ssr.js
↓
X
📄 package-lock.json
↓
X
📄 package.json
↓
X
📁 public/
X
📁 src/
X
SAVING...
BERHASIL DIUBAH!
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 } }) }) }) }
SIMPAN PERUBAHAN