| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,18 @@ | |||
| 1 | 1 | const path = require('path') | |
| 2 | 2 | ||
| 3 | + const visit = require('unist-util-visit') | ||
| 4 | + | ||
| 5 | + /** @type {import('unified').Plugin<Array<void>, import('hast').Root>} */ | ||
| 6 | + function rehypeMetaAsAttributes() { | ||
| 7 | + return (tree) => { | ||
| 8 | + visit(tree, 'element', (node) => { | ||
| 9 | + if (node.tagName === 'code' && node.data && node.data.meta) { | ||
| 10 | + node.properties.meta = node.data.meta | ||
| 11 | + } | ||
| 12 | + }) | ||
| 13 | + } | ||
| 14 | + } | ||
| 15 | + | ||
| 3 | 16 | module.exports = { | |
| 4 | 17 | pathPrefix: `${process.env.PATH_PREFIX}`, | |
| 5 | 18 | siteMetadata: { | |
@@ -31,8 +44,9 @@ module.exports = { | |||
| 31 | 44 | siteUrl: "https://wiki.mcjava.dev", | |
| 32 | 45 | author: 'Kas-tle', | |
| 33 | 46 | docSearch: { | |
| 34 | - apiKey: 'da0ca3a42123b75779221abdd6edf8b6', | ||
| 47 | + apiKey: 'b682d90da6cabb2ac9a4d1d236b24d92', | ||
| 35 | 48 | indexName: 'mcjava', | |
| 49 | + appId: '3QIDHF9CHG', | ||
| 36 | 50 | }, | |
| 37 | 51 | }, | |
| 38 | 52 | plugins: [ | |
@@ -55,29 +69,26 @@ module.exports = { | |||
| 55 | 69 | resolve: 'gatsby-plugin-mdx', | |
| 56 | 70 | options: { | |
| 57 | 71 | extensions: [`.mdx`, `.md`], | |
| 72 | + mdxOptions: { | ||
| 73 | + remarkPlugins: [ | ||
| 74 | + require(`remark-gfm`), | ||
| 75 | + ], | ||
| 76 | + rehypePlugins: [rehypeMetaAsAttributes], | ||
| 77 | + }, | ||
| 58 | 78 | gatsbyRemarkPlugins: [ | |
| 59 | - { | ||
| 60 | - resolve: require.resolve( | ||
| 61 | - './src/plugins/gatsby-remark-autolink-headers', | ||
| 62 | - ), | ||
| 63 | - }, | ||
| 64 | 79 | { | |
| 65 | 80 | resolve: `gatsby-remark-images`, | |
| 66 | 81 | options: { | |
| 67 | 82 | maxWidth: 1200, | |
| 68 | 83 | }, | |
| 69 | 84 | }, | |
| 85 | + { resolve: 'gatsby-remark-autolink-headers' }, | ||
| 70 | 86 | ], | |
| 71 | 87 | }, | |
| 72 | 88 | }, | |
| 73 | 89 | 'gatsby-transformer-sharp', | |
| 74 | 90 | 'gatsby-plugin-sharp', | |
| 75 | 91 | 'gatsby-plugin-react-helmet', | |
| 76 | - { | ||
| 77 | - resolve: require.resolve( | ||
| 78 | - './src/plugins/gatsby-remark-autolink-headers', | ||
| 79 | - ), | ||
| 80 | - }, | ||
| 81 | 92 | ||
| 82 | 93 | // Source | |
| 83 | 94 | { | |
@@ -94,10 +105,18 @@ module.exports = { | |||
| 94 | 105 | name: 'default-image', | |
| 95 | 106 | }, | |
| 96 | 107 | }, | |
| 108 | + { | ||
| 109 | + resolve: 'gatsby-source-filesystem', | ||
| 110 | + options: { | ||
| 111 | + path: `./pages/docs`, | ||
| 112 | + name: 'doc', | ||
| 113 | + }, | ||
| 114 | + }, | ||
| 97 | 115 | { | |
| 98 | 116 | resolve: 'gatsby-source-filesystem', | |
| 99 | 117 | options: { | |
| 100 | 118 | path: `./pages`, | |
| 119 | + ignore: ['**/docs/**'], | ||
| 101 | 120 | name: 'page', | |
| 102 | 121 | }, | |
| 103 | 122 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,7 @@ function createSchemaCustomization({ actions }) { | |||
| 14 | 14 | type AlgoliaDocSearchMetadata { | |
| 15 | 15 | apiKey: String! | |
| 16 | 16 | indexName: String! | |
| 17 | + appId: String | ||
| 17 | 18 | } | |
| 18 | 19 | ||
| 19 | 20 | type SiteSiteMetadata { | |
@@ -29,6 +30,7 @@ function createSchemaCustomization({ actions }) { | |||
| 29 | 30 | ||
| 30 | 31 | type MdxFrontmatter { | |
| 31 | 32 | title: String! | |
| 33 | + description: String | ||
| 32 | 34 | slug: String | |
| 33 | 35 | section: String | |
| 34 | 36 | order: Int | |
@@ -55,7 +57,7 @@ async function onPreBootstrap(options) { | |||
| 55 | 57 | function onCreateMdxNode({ node, getNode, actions }, options) { | |
| 56 | 58 | const { createNodeField } = actions | |
| 57 | 59 | const slug = node.frontmatter.slug || createFilePath({ node, getNode }) | |
| 58 | - const pageType = /\/pages\/docs\//.test(node.fileAbsolutePath) | ||
| 60 | + const pageType = /\/pages\/docs\//.test(node.internal.contentFilePath) | ||
| 59 | 61 | ? 'doc' | |
| 60 | 62 | : 'page' | |
| 61 | 63 | ||
@@ -131,7 +133,10 @@ function onCreateMdxNode({ node, getNode, actions }, options) { | |||
| 131 | 133 | } = options | |
| 132 | 134 | const repositoryURL = githubRepositoryURL | |
| 133 | 135 | if (!baseDirectory || !repositoryURL) return '' | |
| 134 | - const relativePath = node.fileAbsolutePath.replace(baseDirectory, '') | ||
| 136 | + const relativePath = node.internal.contentFilePath.replace( | ||
| 137 | + baseDirectory, | ||
| 138 | + '', | ||
| 139 | + ) | ||
| 135 | 140 | return `${repositoryURL}/blob/${githubDefaultBranch}${relativePath}` | |
| 136 | 141 | } | |
| 137 | 142 | ||
@@ -143,7 +148,7 @@ function onCreateMdxNode({ node, getNode, actions }, options) { | |||
| 143 | 148 | } | |
| 144 | 149 | ||
| 145 | 150 | function onCreateNode(...args) { | |
| 146 | - if (args[0].node.internal.type === `Mdx`) { | ||
| 151 | + if (args[0].node.internal.type === 'Mdx') { | ||
| 147 | 152 | onCreateMdxNode(...args) | |
| 148 | 153 | } | |
| 149 | 154 | } | |
@@ -167,6 +172,9 @@ async function createPages({ graphql, actions, reporter }) { | |||
| 167 | 172 | sourceInstanceName | |
| 168 | 173 | } | |
| 169 | 174 | } | |
| 175 | + internal { | ||
| 176 | + contentFilePath | ||
| 177 | + } | ||
| 170 | 178 | } | |
| 171 | 179 | } | |
| 172 | 180 | } | |
@@ -175,6 +183,7 @@ async function createPages({ graphql, actions, reporter }) { | |||
| 175 | 183 | ||
| 176 | 184 | if (errors) { | |
| 177 | 185 | reporter.panicOnBuild(`Error while running GraphQL query.`) | |
| 186 | + console.log(errors) | ||
| 178 | 187 | return | |
| 179 | 188 | } | |
| 180 | 189 | ||
@@ -197,16 +206,19 @@ async function createPages({ graphql, actions, reporter }) { | |||
| 197 | 206 | toPath: node.fields.redirect, | |
| 198 | 207 | redirectInBrowser: true, | |
| 199 | 208 | }) | |
| 209 | + return | ||
| 200 | 210 | } | |
| 201 | 211 | ||
| 202 | 212 | createPage({ | |
| 203 | 213 | path: node.fields.slug, | |
| 204 | 214 | component: path.resolve( | |
| 205 | 215 | __dirname, | |
| 206 | - `./src/templates/${node.fields.pageType}.js`, | ||
| 216 | + `./src/templates/${node.fields.pageType}.js?__contentFilePath=${node.internal.contentFilePath}`, | ||
| 207 | 217 | ), | |
| 208 | 218 | context: { | |
| 209 | 219 | id: node.id, | |
| 220 | + frontmatter: node.frontmatter, | ||
| 221 | + contentFilePath: node.internal.contentFilePath, | ||
| 210 | 222 | }, | |
| 211 | 223 | }) | |
| 212 | 224 | }) | |
@@ -233,15 +245,30 @@ const pluginOptionsSchema = (/** @type {{ Joi: import('joi') }} */ { Joi }) => { | |||
| 233 | 245 | docSearch: Joi.object({ | |
| 234 | 246 | apiKey: Joi.string().required(), | |
| 235 | 247 | indexName: Joi.string().required(), | |
| 248 | + appId: Joi.string(), | ||
| 236 | 249 | }), | |
| 237 | 250 | sitemap: Joi.object(), | |
| 238 | 251 | }) | |
| 239 | 252 | } | |
| 240 | 253 | ||
| 254 | + const onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => { | ||
| 255 | + actions.setWebpackConfig({ | ||
| 256 | + module: { | ||
| 257 | + rules: [ | ||
| 258 | + { | ||
| 259 | + test: /\.mdx$/, | ||
| 260 | + use: '@mdx-js/loader', | ||
| 261 | + }, | ||
| 262 | + ], | ||
| 263 | + }, | ||
| 264 | + }) | ||
| 265 | + } | ||
| 266 | + | ||
| 241 | 267 | module.exports = { | |
| 242 | 268 | createSchemaCustomization, | |
| 243 | 269 | onPreBootstrap, | |
| 244 | 270 | onCreateNode, | |
| 245 | 271 | createPages, | |
| 246 | 272 | pluginOptionsSchema, | |
| 273 | + onCreateWebpackConfig, | ||
| 247 | 274 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,42 +10,44 @@ | |||
| 10 | 10 | "dependencies": { | |
| 11 | 11 | "@docsearch/css": "^3.3.2", | |
| 12 | 12 | "@docsearch/react": "^3.3.2", | |
| 13 | - "@mdx-js/mdx": "^1.6.22", | ||
| 14 | - "@mdx-js/react": "^1.6.22", | ||
| 15 | - "@xstyled/styled-components": "^2.5.0", | ||
| 16 | - "babel-plugin-styled-components": "^1.13.3", | ||
| 17 | - "fs-extra": "^9.1.0", | ||
| 13 | + "@mdx-js/loader": "^2.1.3", | ||
| 14 | + "@mdx-js/react": "^2.1.3", | ||
| 15 | + "@xstyled/styled-components": "^3.6.0", | ||
| 16 | + "ariakit": "^2.0.0-next.41", | ||
| 17 | + "babel-plugin-styled-components": "2.0.2", | ||
| 18 | + "babel-preset-gatsby": "^2.19.0", | ||
| 19 | + "fs-extra": "^10.1.0", | ||
| 18 | 20 | "gatsby-plugin-catch-links": "^4.25.0", | |
| 19 | 21 | "gatsby-plugin-compile-es6-packages": "^2.1.1", | |
| 20 | 22 | "gatsby-plugin-image": "^2.25.0", | |
| 21 | 23 | "gatsby-plugin-manifest": "^4.25.0", | |
| 22 | - "gatsby-plugin-mdx": "^3.20.0", | ||
| 24 | + "gatsby-plugin-mdx": "^4.3.0", | ||
| 23 | 25 | "gatsby-plugin-meta-redirect": "^1.1.1", | |
| 24 | 26 | "gatsby-plugin-react-helmet": "^5.25.0", | |
| 25 | 27 | "gatsby-plugin-robots-txt": "^1.8.0", | |
| 26 | 28 | "gatsby-plugin-sharp": "^4.25.0", | |
| 27 | 29 | "gatsby-plugin-sitemap": "^5.25.0", | |
| 28 | 30 | "gatsby-plugin-styled-components": "^5.25.0", | |
| 31 | + "gatsby-remark-autolink-headers": "^5.19.0", | ||
| 29 | 32 | "gatsby-remark-images": "^5.12.0", | |
| 30 | 33 | "gatsby-source-filesystem": "^3.15.0", | |
| 31 | 34 | "gatsby-transformer-sharp": "^3.15.0", | |
| 32 | 35 | "github-slugger": "^1.5.0", | |
| 33 | - "mdast-util-to-string": "^2.0.0", | ||
| 34 | 36 | "parse-numeric-range": "^1.3.0", | |
| 35 | 37 | "polished": "^4.2.2", | |
| 36 | 38 | "prism-react-renderer": "^1.3.5", | |
| 37 | 39 | "prismjs": "^1.29.0", | |
| 38 | 40 | "react-helmet": "^6.1.0", | |
| 39 | 41 | "react-icons": "^4.7.1", | |
| 40 | 42 | "react-live": "^2.4.1", | |
| 41 | - "reakit": "^1.3.11", | ||
| 43 | + "remark-gfm": "^1.0.0", | ||
| 42 | 44 | "styled-components": "^5.3.6", | |
| 43 | 45 | "unist-util-visit": "^2.0.3" | |
| 44 | 46 | }, | |
| 45 | 47 | "devDependencies": { | |
| 46 | 48 | "gatsby": "^4.25.4", | |
| 47 | - "react": "^17.0.2", | ||
| 48 | - "react-dom": "^17.0.2", | ||
| 49 | + "react": "^18.2.0", | ||
| 50 | + "react-dom": "^18.2.0", | ||
| 49 | 51 | "standard-version": "^9.5.0" | |
| 50 | 52 | } | |
| 51 | 53 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,11 +20,11 @@ Much of the information regarding more advanced use of Minecraft resource packs | |||
| 20 | 20 | The official discord server for this project. The primary purpose of this Discord is to support and facilitate contributions to this wiki, though resource pack support is also availible. | |
| 21 | 21 | ||
| 22 | 22 | <a href="https://discord.gg/rqsKmmh89J"> | |
| 23 | - <div style="display: inline-block;"> | ||
| 24 | - <RiDiscordFill style={{ width: 32, height: 32 }} /> | ||
| 23 | + <div style={{ display: 'inline-block' }}> | ||
| 24 | + <RiDiscordFill style={{ width: '32px', height: '32px' }} /> | ||
| 25 | 25 | </div> | |
| 26 | - <div style="display: inline-block;"> | ||
| 27 | - <RiCheckboxCircleFill style={{ width: 32, height: 32 }} /> | ||
| 26 | + <div style={{ display: 'inline-block' }}> | ||
| 27 | + <RiCheckboxCircleFill style={{ width: '32px', height: '32px' }} /> | ||
| 28 | 28 | </div> | |
| 29 | 29 | </a> | |
| 30 | 30 | ||
@@ -33,11 +33,11 @@ The official discord server for this project. The primary purpose of this Discor | |||
| 33 | 33 | The official Discord of the 3D modeling program Blockbench. Blockbench is the most commonly used Minecraft 3D modeling program. Though the Discord is primarily for supporting Blockbench, general resource pack help is also commonly provided for all platforms Blockbench supports. | |
| 34 | 34 | ||
| 35 | 35 | <a target="_blank" rel="noopener noreferrer" href="https://discord.gg/7aHWJnFXz9"> | |
| 36 | - <div style="display: inline-block;"> | ||
| 37 | - <RiDiscordFill style={{ width: 32, height: 32 }} /> | ||
| 36 | + <div style={{ display: 'inline-block' }}> | ||
| 37 | + <RiDiscordFill style={{ width: '32px', height: '32px' }} /> | ||
| 38 | 38 | </div> | |
| 39 | - <div style="display: inline-block;"> | ||
| 40 | - <RiCheckboxCircleFill style={{ width: 32, height: 32 }} /> | ||
| 39 | + <div style={{ display: 'inline-block' }}> | ||
| 40 | + <RiCheckboxCircleFill style={{ width: '32px', height: '32px' }} /> | ||
| 41 | 41 | </div> | |
| 42 | 42 | </a> | |
| 43 | 43 | ||
@@ -46,11 +46,11 @@ The official Discord of the 3D modeling program Blockbench. Blockbench is the mo | |||
| 46 | 46 | The official Minecraft Discord server. Some help is offered for both Bedrock and Java resource packs, though it can be quite chaotic given the size of the Discord. The search functionality is sometimes useful due to the shear number of questions that have been asked. | |
| 47 | 47 | ||
| 48 | 48 | <a target="_blank" rel="noopener noreferrer" href="https://discord.gg/minecraft"> | |
| 49 | - <div style="display: inline-block;"> | ||
| 50 | - <RiDiscordFill style={{ width: 32, height: 32 }} /> | ||
| 49 | + <div style={{ display: 'inline-block' }}> | ||
| 50 | + <RiDiscordFill style={{ width: '32px', height: '32px' }} /> | ||
| 51 | 51 | </div> | |
| 52 | - <div style="display: inline-block;"> | ||
| 53 | - <RiCheckboxCircleFill style={{ width: 32, height: 32 }} /> | ||
| 52 | + <div style={{ display: 'inline-block' }}> | ||
| 53 | + <RiCheckboxCircleFill style={{ width: '32px', height: '32px' }} /> | ||
| 54 | 54 | </div> | |
| 55 | 55 | </a> | |
| 56 | 56 | ||
@@ -59,11 +59,11 @@ The official Minecraft Discord server. Some help is offered for both Bedrock and | |||
| 59 | 59 | A Discord primarily focused on voxel modeling for Minecraft: Java Edition. This Discord may be especially helpful for users of Cubik, as this is the tool of choice for voxel-style Minecraft models. | |
| 60 | 60 | ||
| 61 | 61 | <a target="_blank" rel="noopener noreferrer" href="https://discord.gg/TXBcQjmQU8"> | |
| 62 | - <div style="display: inline-block;"> | ||
| 63 | - <RiDiscordFill style={{ width: 32, height: 32 }} /> | ||
| 62 | + <div style={{ display: 'inline-block' }}> | ||
| 63 | + <RiDiscordFill style={{ width: '32px', height: '32px' }} /> | ||
| 64 | 64 | </div> | |
| 65 | - <div style="display: inline-block;"> | ||
| 66 | - <RiCheckboxCircleFill style={{ width: 32, height: 32 }} /> | ||
| 65 | + <div style={{ display: 'inline-block' }}> | ||
| 66 | + <RiCheckboxCircleFill style={{ width: '32px', height: '32px' }} /> | ||
| 67 | 67 | </div> | |
| 68 | 68 | </a> | |
| 69 | 69 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -230,13 +230,6 @@ My favorite browser is: | |||
| 230 | 230 | <hello@gmail.com> | |
| 231 | 231 | ``` | |
| 232 | 232 | ||
| 233 | - My favorite browser is: | ||
| 234 | - [Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/developer/ "The best browser! (and this hover tip is optional)"). | ||
| 235 | - | ||
| 236 | - <https://wiki.mcjava.dev/> | ||
| 237 | - | ||
| 238 | - <hello@gmail.com> | ||
| 239 | - | ||
| 240 | 233 | *** | |
| 241 | 234 | ||
| 242 | 235 | ```md title={Inline Code} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments