Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit aa0692a

Browse files
committed
allow for nested mdx
1 parent 8ffec5a commit aa0692a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ module.exports = withBundleAnalyzer({
3636
config.module.rules.push({
3737
test: /\.mdx$/,
3838
oneOf: [
39+
{
40+
test: /snippets/,
41+
use: mdx,
42+
},
3943
{
4044
resourceQuery: /preview/,
4145
use: [

src/getAllPostPreviews.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ function dateSortDesc(a, b) {
1313

1414
export default function getAllPostPreviews() {
1515
return importAll(require.context('./pages/?preview', true, /\.mdx$/))
16+
.filter((p) => !p.link.includes('snippets'))
1617
.filter((p) => p.module.meta.private !== true)
1718
.sort((a, b) => dateSortDesc(a.module.meta.date, b.module.meta.date))
1819
}
1920

2021
export function getAllPosts() {
2122
return importAll(require.context('./pages/?rss', true, /\.mdx$/))
23+
.filter((p) => !p.link.includes('snippets'))
2224
.filter((p) => p.module.meta.private !== true)
2325
.sort((a, b) => dateSortDesc(a.module.meta.date, b.module.meta.date))
2426
}

0 commit comments

Comments
 (0)