-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
280 additions
and
423 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,8 +1,15 @@ | ||
import MdxContent from "./howToUse.mdx"; | ||
import MdxContent from "@/app/(home)/(mdx_documents)/help/edit/page.mdx"; | ||
import Link from "next/link"; | ||
export default function HowToUse() { | ||
return ( | ||
<div className="p-8 mx-auto max-w-6xl w-full"> | ||
<MdxContent /> | ||
<h2 className="mt-4"> | ||
詳しい使い方は | ||
<Link href="/help" className="!text-heading-M" target="_target"> | ||
こちら | ||
</Link> | ||
</h2> | ||
</div> | ||
); | ||
} |
15 changes: 12 additions & 3 deletions
15
app/(app)/app/howToUse.mdx → ...(home)/(mdx_documents)/help/edit/page.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
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,29 @@ | ||
export const metadata = { | ||
title: "キーボードショートカットに付いて", | ||
description: | ||
"英文、英単語専用の単語帳アプリvocabPhraseのキーボードショートカットについて", | ||
alternates: { | ||
canonical: "/help/keyboard", | ||
}, | ||
}; | ||
|
||
# キーボードショートカットについて | ||
|
||
## 編集ページ | ||
|
||
| キー | 機能 | | ||
| -------- | ---- | | ||
| Ctrl + S | 保存 | | ||
|
||
## フラッシュカード | ||
|
||
### フラッシュカードで暗記中 | ||
|
||
| キー | 機能 | | ||
| ---------- | ---------------------------------------- | | ||
| space | 解答を表示(キーボード解答モードオフ時) | | ||
| ctrl+enter | 解答する(キーボード解答時) | | ||
| c | チェックを付ける、はずす(解答表示時のみ) | | ||
| r,s | 読み上げ | | ||
| → | 次へ | | ||
| ← | 前へ | |
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,13 @@ | ||
import Link from "next/link"; | ||
import { ReactNode } from "react"; | ||
|
||
export default function HelpPageLayout({ children }: { children: ReactNode }) { | ||
return ( | ||
<> | ||
<section> | ||
<Link href="/help">ヘルプページトップへ</Link> | ||
</section> | ||
{children} | ||
</> | ||
); | ||
} |
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,20 @@ | ||
import { promises as fsPromises } from "fs"; | ||
import path from "path"; | ||
export async function getFileMetadata(): Promise< | ||
{ fileName: string; title: string; description: string }[] | ||
> { | ||
const files = ( | ||
await fsPromises.readdir( | ||
path.join(process.cwd(), "app", "(home)", "(mdx_documents)", "help") | ||
) | ||
).filter((file) => !file.includes(".")); | ||
files.sort(); //文字列のみなので比較関数は不要 | ||
return await Promise.all( | ||
files.map(async (file) => { | ||
const { metadata } = await import( | ||
`@/app/(home)/(mdx_documents)/help/${file}/page.mdx` | ||
); | ||
return { fileName: file, ...metadata }; | ||
}) | ||
); | ||
} |
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,32 @@ | ||
import { promises as fsPromises } from "fs"; | ||
import { Metadata } from "next"; | ||
import Link from "next/link"; | ||
import path from "path"; | ||
import { getFileMetadata } from "./getFileMetadata"; | ||
export default async function HelpTop() { | ||
const metadatas = await getFileMetadata(); | ||
return ( | ||
<section> | ||
<h2> ヘルプ記事一覧 </h2> | ||
<ul> | ||
{metadatas.map((metadata) => ( | ||
<li key={metadata.fileName}> | ||
<Link href={`/help/${metadata.fileName}`}>{metadata.title}</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</section> | ||
); | ||
} | ||
export const metadata: Metadata = { | ||
title: "ヘルプページトップ", | ||
description: | ||
"英文、英単語専用の単語帳アプリVocabPhraseのヘルプページトップです。", | ||
alternates: { | ||
canonical: "/help", | ||
}, | ||
robots: { | ||
index: false, | ||
follow: 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
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,26 @@ | ||
"use client"; | ||
import { useHotkeys } from "react-hotkeys-hook"; | ||
|
||
export default function HelpKeyShortCut() { | ||
useHotkeys( | ||
"f1,?,shift+/", | ||
() => { | ||
window.open("/help", "_blank"); | ||
}, | ||
{ | ||
preventDefault: true, | ||
enableOnFormTags: ["INPUT", "TEXTAREA", "SELECT"], | ||
} | ||
); | ||
useHotkeys( | ||
"ctrl+/", | ||
() => { | ||
window.open("/help/keyboard", "_blank"); | ||
}, | ||
{ | ||
preventDefault: true, | ||
enableOnFormTags: ["INPUT", "TEXTAREA", "SELECT"], | ||
} | ||
); | ||
return <></>; | ||
} |
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,11 +1,20 @@ | ||
import { MetadataRoute } from "next"; | ||
import { getFileMetadata } from "./(home)/help/getFileMetadata"; | ||
|
||
export default function sitemap(): MetadataRoute.Sitemap { | ||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
const helpPages = (await getFileMetadata()) | ||
.map((page) => page.fileName) | ||
.flat(); | ||
return [ | ||
{ | ||
url: "https://vocab-phrase.vercel.app/", | ||
priority: 1, | ||
lastModified: new Date(), | ||
}, | ||
]; | ||
helpPages.map((page) => ({ | ||
url: `https://vocab-phrase.vercel.app/help/${page}`, | ||
priority: 0.5, | ||
lastModified: new Date(), | ||
})), | ||
].flat(); | ||
} |
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.