Skip to content

Commit 706df3a

Browse files
committed
🐛 fix: implement core page structure, error decoder system, and site initialization configuration as in the main version of the project
1 parent 02956d4 commit 706df3a

3 files changed

Lines changed: 25 additions & 8 deletions

File tree

next.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,30 @@ const nextConfig = {
1919
scrollRestoration: true,
2020
reactCompiler: true,
2121
},
22+
async rewrites() {
23+
return {
24+
beforeFiles: [
25+
// Explicit .md extension also serves markdown
26+
{
27+
source: '/:path*.md',
28+
destination: '/api/md/:path*',
29+
},
30+
// Serve markdown when Accept header prefers text/markdown
31+
// Useful for LLM agents - https://www.skeptrune.com/posts/use-the-accept-header-to-serve-markdown-instead-of-html-to-llms/
32+
{
33+
source: '/:path((?!llms\\.txt|api/md).*)',
34+
has: [
35+
{
36+
type: 'header',
37+
key: 'accept',
38+
value: '(.*text/markdown.*)',
39+
},
40+
],
41+
destination: '/api/md/:path*',
42+
},
43+
],
44+
};
45+
},
2246
env: {},
2347
webpack: (config, {dev, isServer, ...options}) => {
2448
if (process.env.ANALYZE) {

src/pages/[[...markdownPath]].js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Copyright (c) Meta Platforms, Inc. and affiliates.
3-
*
4-
* This source code is licensed under the MIT license found in the
5-
* LICENSE file in the root directory of this source tree.
6-
*/
7-
81
/*
92
* Copyright (c) Facebook, Inc. and its affiliates.
103
*/

src/pages/_document.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const MyDocument = () => {
6060
document.documentElement.classList.add('uwu');
6161
if (!logShown) {
6262
console.log('uwu mode! turn off with ?uwu=0');
63-
console.log('logo credit to @sawaratsuki1004 via https://github.com/SAWARATSUKI/ServiceLogos');
63+
console.log('logo credit to @sawaratsuki1004 via https://github.com/SAWARATSUKI/KawaiiLogos');
6464
logShown = true;
6565
}
6666
} else {

0 commit comments

Comments
 (0)