-
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.
- Loading branch information
Showing
8 changed files
with
143 additions
and
430 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: "This is a sample markdown file" | ||
date: "2021-08-01" | ||
description: "This is a sample markdown file for testing" | ||
--- | ||
|
||
## Heading 2 | ||
|
||
This is a paragraph. | ||
|
||
- This is a list item | ||
- This is another list item | ||
|
||
This is a code block: | ||
|
||
```javascript | ||
console.log("Hello, world!"); | ||
``` | ||
|
||
Also supports inline code: `console.log("Hello, world!")` | ||
|
||
This is a link: [Google](https://www.google.com) | ||
|
||
This is an image: | ||
![Image](https://via.placeholder.com/150) | ||
|
||
Support GFM | ||
|
||
- [x] Task list item 1 | ||
- [ ] Task list item 2 | ||
- [ ] Task list item 3 | ||
|
||
This is a table: | ||
|
||
| Header 1 | Header 2 | | ||
| -------- | -------- | | ||
| Cell 1 | Cell 2 | | ||
| Cell 3 | Cell 4 | | ||
|
||
This is a blockquote: | ||
|
||
> This is a blockquote | ||
> This is another line of the blockquote | ||
This is a horizontal rule: | ||
|
||
--- | ||
|
||
And this is a footnote[^1]. | ||
|
||
[^1]: This is a footnote. |
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,4 +1,17 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
output: "export", | ||
webpack: (config, { webpack }) => { | ||
return { | ||
...config, | ||
plugins: [ | ||
...config.plugins, | ||
new webpack.IgnorePlugin({ | ||
resourceRegExp: /^electron$/, | ||
}), | ||
], | ||
}; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
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,34 @@ | ||
import { parseMarkdownToHTML } from "@saitamau-maximum/markdown-processor/server"; | ||
import Link from "next/link"; | ||
|
||
import { | ||
getBlogDataFromSlug, | ||
getBlogPathList, | ||
getBlogSlugFromPath, | ||
} from "../../../util/markdown"; | ||
|
||
export async function generateStaticParams() { | ||
const paths = await getBlogPathList(); | ||
const slugs = paths.map(getBlogSlugFromPath); | ||
return slugs.map((slug) => ({ slug })); | ||
} | ||
|
||
interface Props { | ||
params: { | ||
slug: string; | ||
}; | ||
} | ||
|
||
export default async function BlogDetail({ params }: Props) { | ||
const { slug } = params; | ||
const { data, content } = await getBlogDataFromSlug(slug); | ||
const parsed = await parseMarkdownToHTML(content); | ||
|
||
return ( | ||
<div> | ||
<h1>{data.title}</h1> | ||
<div dangerouslySetInnerHTML={{ __html: parsed.content }} /> | ||
<Link href="/">Back to Home</Link> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.