Skip to content

Commit c07c6b7

Browse files
committed
feat: setup static export for nextra
1 parent 7af43e7 commit c07c6b7

9 files changed

+86
-251
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ yarn-error.log
1313
.cache
1414
.vscode
1515
.DS_Store
16-
out/*
17-
out
16+
dist
1817
.dccache
1918
*.code-workspace
2019
.direnv

netlify.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
[build]
22
command = "next build"
3-
publish = ".next"
3+
publish = "dist"
4+
5+
[[redirects]]
6+
from = "/restake"
7+
to = "/restake/introduction"
8+
status = 301
9+
10+
[[redirects]]
11+
from = "/developers"
12+
to = "/developers/blueprints/introduction"
13+
status = 301
14+
15+
[[redirects]]
16+
from = "/operators"
17+
to = "/operators/introduction"
18+
status = 301

next-sitemap.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ const config = {
33
siteUrl: process.env.SITE_URL || "https://docs.tangle.tools",
44
generateRobotsTxt: true,
55
exclude: ["/404", "/500", "/api/*", "*/_meta"],
6-
outDir: "public",
7-
generateIndexSitemap: true,
6+
outDir: "dist",
87
};
98

109
export default config;

next.config.mjs

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,12 @@ const withBundleAnalyzer = bundleAnalyzer({
1717
* @type {import('next').NextConfig}
1818
*/
1919
const nextConfig = {
20+
output: "export",
2021
reactStrictMode: true,
2122
trailingSlash: false,
2223
staticPageGenerationTimeout: 120,
23-
async redirects() {
24-
return [
25-
{
26-
source: "/restake",
27-
destination: "/restake/introduction/",
28-
permanent: true,
29-
},
30-
{
31-
source: "/developers",
32-
destination: "/developers/blueprints/introduction",
33-
permanent: true,
34-
},
35-
{
36-
source: "/operators",
37-
destination: "/operators/introduction/",
38-
permanent: true,
39-
},
40-
];
41-
},
42-
rewrites() {
43-
return {
44-
// beforeFiles: [
45-
// {
46-
// source: "/sitemap.xml",
47-
// destination:
48-
// //TODO: SUBMIT SITE MAP
49-
// "",
50-
// },
51-
// ],
52-
};
53-
},
5424
images: {
25+
unoptimized: true,
5526
remotePatterns: [
5627
{
5728
protocol: "https",
@@ -63,6 +34,7 @@ const nextConfig = {
6334
},
6435
],
6536
},
37+
distDir: "dist",
6638
};
6739

6840
export default withBundleAnalyzer(withNextra(nextConfig));

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"scripts": {
88
"dev": "next",
99
"start": "next start",
10-
"build": "next build && yarn build:sitemap",
10+
"build": "next build && yarn build:sitemap && yarn build:pagefind",
1111
"build:sitemap": "next-sitemap --config next-sitemap.config.js",
12+
"build:pagefind": "pagefind --site .next/server/pages --output-path dist/_pagefind",
1213
"export": "next export",
1314
"lint": "next lint && yarn format",
1415
"schema": "turbo-gen ./public/schema.json",
@@ -55,6 +56,7 @@
5556
"eslint-config-next": "^14.2.5",
5657
"eslint-config-prettier": "8.5.0",
5758
"gray-matter": "^4.0.3",
59+
"pagefind": "^1.3.0",
5860
"postcss": "^8.5.3",
5961
"prettier": "3.2.5",
6062
"shiki": "^3.2.1",

pages/api/subscribers.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)