Skip to content

Commit b976f8d

Browse files
author
tkokhing
committed
maj revamp, upgr Next15 to Next16, and associated deps
1 parent 484d9a9 commit b976f8d

17 files changed

Lines changed: 2541 additions & 3589 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Deploy tkokhing main page to GitHub Pages
22

33
on:
4-
# repository_dispatch:
5-
# types: [auto-trigger-rebuild]
6-
74
repository_dispatch:
85
types: [app-trigger-rebuild]
96

@@ -146,17 +143,13 @@ jobs:
146143
echo "Unable to determine package manager"
147144
exit 1
148145
fi
149-
150146
- name: Setup Node
151147
uses: actions/setup-node@v4
152148
with:
153149
node-version: "20"
154150
cache: ${{ steps.detect-package-manager.outputs.manager }}
155-
156151
- name: Setup Pages
157152
uses: actions/configure-pages@v5
158-
159-
160153
- name: Restore cache
161154
uses: actions/cache@v4
162155
with:
@@ -165,13 +158,10 @@ jobs:
165158
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
166159
restore-keys: |
167160
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
168-
169161
- name: Install dependencies
170162
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
171-
172163
- name: Build with Next.js
173164
run: ${{ steps.detect-package-manager.outputs.runner }} next build
174-
175165
- name: Upload artifact
176166
uses: actions/upload-pages-artifact@v3
177167
with:

next.config.mjs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
2-
// next.config.mjs
1+
// next.config.mjs, implemented with @next/mdx, serves for `import` of *.MDX
32
import createMDX from "@next/mdx";
4-
import remarkGfm from "remark-gfm";
5-
import rehypePrettyCode from "rehype-pretty-code";
3+
// import rehypePrettyCode from "rehype-pretty-code";
4+
// import remarkGfm from "remark-gfm";
5+
// import rehypePrettyCode from "rehype-pretty-code";
6+
// From Next v16+, import packages no longer required hence call as string under [options]
67

78
/** @type {import('rehype-pretty-code').Options} */
89
const prettyOptions = {
@@ -11,21 +12,21 @@ const prettyOptions = {
1112
};
1213

1314
const withMDX = createMDX({
14-
extension: /\.mdx?$/,
1515
options: {
16-
remarkPlugins: [remarkGfm],
17-
rehypePlugins: [[rehypePrettyCode, prettyOptions]],
16+
remarkPlugins: ["remark-gfm"],
17+
rehypePlugins: [["rehype-pretty-code", prettyOptions], "rehype-slug", "rehype-autolink-headings"],
1818
},
19+
extension: /\.mdx?$/,
1920
});
2021

2122
/** @type {import('next').NextConfig} */
2223
const nextConfig = {
23-
// turn off mdxRs for plugin support
24+
// mdxRs MUST be FALSE for remark/rehype plugins to work
2425
experimental: { mdxRs: false },
2526
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
2627
output: "export",
2728
distDir: "dist",
2829
images: { unoptimized: true },
2930
};
3031

31-
export default withMDX(nextConfig);
32+
export default withMDX(nextConfig);

0 commit comments

Comments
 (0)