-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e325a6
commit dce4b6a
Showing
110 changed files
with
3,450 additions
and
717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
env: | ||
browser: true | ||
node: true | ||
es2021: true | ||
extends: | ||
- 'next/core-web-vitals' | ||
- 'prettier' | ||
- plugin:mdx/recommended | ||
- 'eslint:recommended' | ||
- 'plugin:mdx/recommended' | ||
- 'plugin:@typescript-eslint/recommended' | ||
- 'plugin:react/recommended' | ||
- 'plugin:mdx/recommended' | ||
plugins: | ||
- '@typescript-eslint' | ||
- 'react' | ||
rules: | ||
'max-params': 'error' | ||
settings: | ||
'mdx/code-blocks': true | ||
react: | ||
version: 'detect' | ||
root: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# gatsby built | ||
.cache | ||
public/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// @ts-check | ||
// NOTE: this file must be a `.mjs` file due to that `remark-gfm` supports only ES Modules and the limitations of `gatsby-config`: https://www.gatsbyjs.com/docs/how-to/custom-configuration/es-modules/#current-limitations | ||
import { dirname } from 'path'; | ||
import remarkGfm from 'remark-gfm'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
/** | ||
* @type {import('gatsby').GatsbyConfig} | ||
*/ | ||
const config = { | ||
siteMetadata: { | ||
title: 'OreOreBot2 Documents', | ||
siteUrl: 'https://haracho.approvers.dev/' | ||
}, | ||
graphqlTypegen: true, | ||
plugins: [ | ||
{ | ||
resolve: 'gatsby-plugin-manifest', | ||
options: { | ||
icon: 'assets/haracho.png' | ||
} | ||
}, | ||
{ | ||
resolve: 'gatsby-plugin-mdx', | ||
options: { | ||
gatsbyRemarkPlugins: [ | ||
{ | ||
resolve: 'gatsby-remark-autolink-headers', | ||
options: { | ||
offsetY: '78' | ||
} | ||
} | ||
], | ||
mdxOptions: { | ||
remarkPlugins: [remarkGfm] | ||
} | ||
} | ||
}, | ||
{ | ||
resolve: 'gatsby-source-filesystem', | ||
options: { | ||
name: 'pages', | ||
path: `${__dirname}/pages` | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import type { GatsbyNode } from 'gatsby'; | ||
import path from 'node:path'; | ||
|
||
import { Page } from './src/types'; | ||
|
||
export const createPages: GatsbyNode['createPages'] = async (api) => { | ||
// get mdx pages | ||
type Content = { | ||
url: string; | ||
title: string; | ||
items?: Content[]; | ||
}; | ||
const res = await api.graphql<{ | ||
allMdx: { | ||
nodes: { | ||
body: string; | ||
tableOfContents: { | ||
items?: Content[]; | ||
}; | ||
parent: { | ||
dir: string; | ||
relativePath: string; | ||
absolutePath: string; | ||
}; | ||
frontmatter: { | ||
title: string; | ||
}; | ||
}[]; | ||
}; | ||
}>(` | ||
{ | ||
allMdx { | ||
nodes { | ||
body | ||
tableOfContents | ||
parent { | ||
... on File { | ||
dir | ||
relativePath | ||
absolutePath | ||
} | ||
} | ||
frontmatter { | ||
title | ||
} | ||
} | ||
} | ||
} | ||
`); | ||
if (res.errors) { | ||
api.reporter.panicOnBuild('querying mdx pages failed'); | ||
return; | ||
} | ||
|
||
const pages = res.data?.allMdx.nodes!.map( | ||
({ | ||
body, | ||
parent: { dir, relativePath, absolutePath }, | ||
frontmatter: { title }, | ||
tableOfContents | ||
}): Page => ({ | ||
body, | ||
dir, | ||
uri: '/' + relativePath.replace(/(index)?\.mdx$/, ''), | ||
absolutePath, | ||
title, | ||
headings: tableOfContents.items | ||
}) | ||
); | ||
|
||
// group pages by its directory | ||
const childrenByPath: Record<string, Page[]> = {}; | ||
for (const page of pages) { | ||
const superPath = page.absolutePath.endsWith('/index.mdx') | ||
? path.dirname(page.dir) | ||
: page.dir; | ||
if (!childrenByPath[superPath]) { | ||
childrenByPath[superPath] = []; | ||
} | ||
childrenByPath[superPath].push(page); | ||
} | ||
|
||
const componentPath = path.resolve('src/templates/entry.jsx'); | ||
for (const page of pages) { | ||
const { body, dir, uri, absolutePath, title, headings } = page; | ||
|
||
const siblings = childrenByPath[path.dirname(dir)] ?? []; | ||
const children = childrenByPath[dir] ?? []; | ||
api.actions.createPage({ | ||
path: uri, | ||
component: `${componentPath}?__contentFilePath=${absolutePath}`, | ||
context: { | ||
body, | ||
title, | ||
siblings, | ||
children, | ||
headings | ||
} | ||
}); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
{ | ||
"name": "@oreorebot2/docs", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"private": true, | ||
"repository": "https://github.com/approvers/OreOreBot2", | ||
"author": "approvers <[email protected]>", | ||
"description": "新生はらちょドキュメントサイト", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"lint": "next lint", | ||
"format": "prettier --write \"./src/**/*.{js,ts,jsx,tsx,md,mdx}\"", | ||
"lint-staged": "lint-staged" | ||
"dev": "gatsby develop", | ||
"build": "gatsby build", | ||
"lint": "eslint --ignore-path .gitignore \"./{src,pages}/**/*.{js,ts,jsx,tsx,md,mdx}\"", | ||
"format": "prettier --write \"./{src,pages}/**/*.{js,ts,jsx,tsx,md,mdx}\"" | ||
}, | ||
"dependencies": { | ||
"next": "^14.0.0", | ||
"nextra": "^2.2.14", | ||
"nextra-theme-docs": "^2.2.14", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
"@mdx-js/mdx": "^3.0.1", | ||
"@mdx-js/react": "^3.0.1", | ||
"gatsby": "^5.13.7", | ||
"gatsby-omni-font-loader": "^2.0.2", | ||
"gatsby-plugin-manifest": "^5.13.1", | ||
"gatsby-plugin-mdx": "^5.13.1", | ||
"gatsby-remark-autolink-headers": "^6.13.1", | ||
"gatsby-source-filesystem": "^5.13.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"remark-gfm": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.60" | ||
"@typescript-eslint/eslint-plugin": "^8.4.0", | ||
"@typescript-eslint/parser": "^8.4.0", | ||
"eslint-plugin-mdx": "^3.1.5", | ||
"eslint-plugin-react": "^7.35.1" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
.../docs/src/pages/development/emoji-seq.mdx → ...ages/docs/pages/development/emoji-seq.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ages/docs/src/pages/development/index.mdx → packages/docs/pages/development/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
title: '開発ガイド' | ||
--- | ||
|
||
# 開発ガイド | ||
|
||
新生はらちょ 開発ガイドへようこそ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.