mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
style: auto-format with Prettier (#20)
style: auto-format with Prettier
This commit is contained in:
+12
-12
@@ -1,8 +1,8 @@
|
||||
const { graphql } = require('gatsby');
|
||||
const { createFilePath } = require("gatsby-source-filesystem");
|
||||
const { graphql } = require("gatsby")
|
||||
const { createFilePath } = require("gatsby-source-filesystem")
|
||||
const path = require(`path`)
|
||||
|
||||
const usersEndpoint = (id) => `https://discordapp.com/api/guilds/${id}/members`;
|
||||
const usersEndpoint = id => `https://discordapp.com/api/guilds/${id}/members`
|
||||
|
||||
const fetchUsers = () => {
|
||||
// Fetch user data from discord using bot token here
|
||||
@@ -13,7 +13,7 @@ const createDocs = async ({ createPage, graphql }) => {
|
||||
|
||||
const result = await graphql(`
|
||||
{
|
||||
allFile(filter: {sourceInstanceName: {eq: "docs"}}) {
|
||||
allFile(filter: { sourceInstanceName: { eq: "docs" } }) {
|
||||
edges {
|
||||
node {
|
||||
relativePath
|
||||
@@ -27,7 +27,7 @@ const createDocs = async ({ createPage, graphql }) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
`)
|
||||
|
||||
if (result.errors) {
|
||||
return Promise.reject(result.errors)
|
||||
@@ -35,28 +35,28 @@ const createDocs = async ({ createPage, graphql }) => {
|
||||
|
||||
return result.data.allFile.edges.forEach(({ node }) => {
|
||||
createPage({
|
||||
path: path.join('docs', node.relativePath),
|
||||
path: path.join("docs", node.relativePath),
|
||||
component: languageDocs,
|
||||
context: {
|
||||
file: node.relativePath
|
||||
file: node.relativePath,
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
exports.onCreateNode = async ({ node, getNode, actions }) => {
|
||||
const { createPage, createNodeField } = actions;
|
||||
const { createPage, createNodeField } = actions
|
||||
if (node.internal.type === "MarkdownRemark") {
|
||||
const slug = createFilePath({ node, getNode, basePath: "src/content/docs" })
|
||||
createNodeField({
|
||||
node,
|
||||
name: "slug",
|
||||
value: slug
|
||||
});
|
||||
value: slug,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
exports.createPages = ({ actions, graphql }) => {
|
||||
const { createPage } = actions
|
||||
return createDocs({ createPage, graphql });
|
||||
}
|
||||
return createDocs({ createPage, graphql })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user