From 0e7778bebf98d951a4d1c4e4c75e97067082b17d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 27 Dec 2020 21:49:39 +0900 Subject: [PATCH] refactor --- src/client/pages/doc.vue | 2 +- src/docs/{aiscript.ja-JP.md => ja-JP/aiscript.md} | 0 src/docs/{api.ja-JP.md => ja-JP/api.md} | 0 src/docs/{create-plugin.ja-JP.md => ja-JP/create-plugin.md} | 0 src/docs/{custom-emoji.ja-JP.md => ja-JP/custom-emoji.md} | 0 src/docs/{follow.ja-JP.md => ja-JP/follow.md} | 0 .../{keyboard-shortcut.ja-JP.md => ja-JP/keyboard-shortcut.md} | 0 src/docs/{mute.ja-JP.md => ja-JP/mute.md} | 0 src/docs/{pages.ja-JP.md => ja-JP/pages.md} | 0 src/docs/{reaction.ja-JP.md => ja-JP/reaction.md} | 0 src/docs/{reversi-bot.ja-JP.md => ja-JP/reversi-bot.md} | 0 src/docs/{stream.ja-JP.md => ja-JP/stream.md} | 0 src/docs/{theme.ja-JP.md => ja-JP/theme.md} | 0 src/docs/{timelines.ja-JP.md => ja-JP/timelines.md} | 0 src/server/web/index.ts | 2 +- 15 files changed, 2 insertions(+), 2 deletions(-) rename src/docs/{aiscript.ja-JP.md => ja-JP/aiscript.md} (100%) rename src/docs/{api.ja-JP.md => ja-JP/api.md} (100%) rename src/docs/{create-plugin.ja-JP.md => ja-JP/create-plugin.md} (100%) rename src/docs/{custom-emoji.ja-JP.md => ja-JP/custom-emoji.md} (100%) rename src/docs/{follow.ja-JP.md => ja-JP/follow.md} (100%) rename src/docs/{keyboard-shortcut.ja-JP.md => ja-JP/keyboard-shortcut.md} (100%) rename src/docs/{mute.ja-JP.md => ja-JP/mute.md} (100%) rename src/docs/{pages.ja-JP.md => ja-JP/pages.md} (100%) rename src/docs/{reaction.ja-JP.md => ja-JP/reaction.md} (100%) rename src/docs/{reversi-bot.ja-JP.md => ja-JP/reversi-bot.md} (100%) rename src/docs/{stream.ja-JP.md => ja-JP/stream.md} (100%) rename src/docs/{theme.ja-JP.md => ja-JP/theme.md} (100%) rename src/docs/{timelines.ja-JP.md => ja-JP/timelines.md} (100%) diff --git a/src/client/pages/doc.vue b/src/client/pages/doc.vue index 402872f0ec..2a4b5b626b 100644 --- a/src/client/pages/doc.vue +++ b/src/client/pages/doc.vue @@ -60,7 +60,7 @@ export default defineComponent({ methods: { fetchDoc() { - fetch(`${url}/assets/docs/${this.doc}.${lang}.md`).then(res => res.text()).then(md => { + fetch(`${url}/assets/docs/${lang}/${this.doc}.md`).then(res => res.text()).then(md => { this.parse(md); }); }, diff --git a/src/docs/aiscript.ja-JP.md b/src/docs/ja-JP/aiscript.md similarity index 100% rename from src/docs/aiscript.ja-JP.md rename to src/docs/ja-JP/aiscript.md diff --git a/src/docs/api.ja-JP.md b/src/docs/ja-JP/api.md similarity index 100% rename from src/docs/api.ja-JP.md rename to src/docs/ja-JP/api.md diff --git a/src/docs/create-plugin.ja-JP.md b/src/docs/ja-JP/create-plugin.md similarity index 100% rename from src/docs/create-plugin.ja-JP.md rename to src/docs/ja-JP/create-plugin.md diff --git a/src/docs/custom-emoji.ja-JP.md b/src/docs/ja-JP/custom-emoji.md similarity index 100% rename from src/docs/custom-emoji.ja-JP.md rename to src/docs/ja-JP/custom-emoji.md diff --git a/src/docs/follow.ja-JP.md b/src/docs/ja-JP/follow.md similarity index 100% rename from src/docs/follow.ja-JP.md rename to src/docs/ja-JP/follow.md diff --git a/src/docs/keyboard-shortcut.ja-JP.md b/src/docs/ja-JP/keyboard-shortcut.md similarity index 100% rename from src/docs/keyboard-shortcut.ja-JP.md rename to src/docs/ja-JP/keyboard-shortcut.md diff --git a/src/docs/mute.ja-JP.md b/src/docs/ja-JP/mute.md similarity index 100% rename from src/docs/mute.ja-JP.md rename to src/docs/ja-JP/mute.md diff --git a/src/docs/pages.ja-JP.md b/src/docs/ja-JP/pages.md similarity index 100% rename from src/docs/pages.ja-JP.md rename to src/docs/ja-JP/pages.md diff --git a/src/docs/reaction.ja-JP.md b/src/docs/ja-JP/reaction.md similarity index 100% rename from src/docs/reaction.ja-JP.md rename to src/docs/ja-JP/reaction.md diff --git a/src/docs/reversi-bot.ja-JP.md b/src/docs/ja-JP/reversi-bot.md similarity index 100% rename from src/docs/reversi-bot.ja-JP.md rename to src/docs/ja-JP/reversi-bot.md diff --git a/src/docs/stream.ja-JP.md b/src/docs/ja-JP/stream.md similarity index 100% rename from src/docs/stream.ja-JP.md rename to src/docs/ja-JP/stream.md diff --git a/src/docs/theme.ja-JP.md b/src/docs/ja-JP/theme.md similarity index 100% rename from src/docs/theme.ja-JP.md rename to src/docs/ja-JP/theme.md diff --git a/src/docs/timelines.ja-JP.md b/src/docs/ja-JP/timelines.md similarity index 100% rename from src/docs/timelines.ja-JP.md rename to src/docs/ja-JP/timelines.md diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 468ece5359..57ce9b38a4 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -110,7 +110,7 @@ router.get('/docs.json', async ctx => { ctx.body = []; return; } - const paths = glob.sync(__dirname + `/../../../src/docs/*.${lang}.md`); + const paths = glob.sync(__dirname + `/../../../src/docs/${lang}/*.md`); const docs: { path: string; title: string; }[] = []; for (const path of paths) { const md = fs.readFileSync(path, { encoding: 'utf8' });