Skip to content

Commit b70be12

Browse files
committed
feat: remove unsed scripts, build sitemap
1 parent b6b95ac commit b70be12

File tree

7 files changed

+157
-201
lines changed

7 files changed

+157
-201
lines changed

components/LandingPage.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ const LandingPage = () => {
8989
</p>
9090
</div>
9191

92-
<div className="relative bottom-0 w-[90%] hidden lg:flex lg:justify-end">
92+
<div className="relative bottom-0 min-w-[512px] min-h-[336px] hidden lg:flex lg:justify-end">
9393
<Image
94+
priority
9495
src="/images/TangleNetworkMap.png"
9596
alt="A visualization of the Tangle Network"
96-
className="z-0"
97-
width={512}
98-
height={336}
97+
className="z-0 w-auto h-auto"
98+
fill
99+
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
99100
/>
100101
</div>
101102
</div>

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"scripts": {
88
"dev": "next",
99
"start": "next start",
10-
"build": "next build",
11-
"postbuild": "next-sitemap",
10+
"build": "next build && yarn build:sitemap",
11+
"build:sitemap": "next-sitemap --config next-sitemap.config.js",
1212
"export": "next export",
1313
"lint": "next lint && yarn format",
1414
"schema": "turbo-gen ./public/schema.json",

pages/_app.tsx

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// _app.tsx
22

3-
import { GoogleAnalytics } from "@next/third-parties/google";
4-
import "katex/dist/katex.min.css";
3+
import "../globals.css";
4+
55
import type { NextPage } from "next";
66
import type { AppProps } from "next/app";
77
import type { ReactElement, ReactNode } from "react";
8-
import { getShikiHighlighter } from "../components/shiki";
9-
import "../globals.css";
108

119
export type NextPageWithLayout<P = object, IP = P> = NextPage<P, IP> & {
1210
getLayout?: (page: ReactElement) => ReactNode;
@@ -23,9 +21,6 @@ if (typeof window !== "undefined" && window.requestIdleCallback === undefined) {
2321
window.cancelIdleCallback = (id: number) => clearTimeout(id);
2422
}
2523

26-
// Initialize the highlighter when the app starts
27-
getShikiHighlighter();
28-
2924
export default function Nextra({ Component, pageProps }: NextraAppProps) {
3025
// Define a layout if it doesn't exist in the page component
3126
const getLayout = Component.getLayout || ((page) => page);
@@ -49,12 +44,7 @@ export default function Nextra({ Component, pageProps }: NextraAppProps) {
4944
</defs>
5045
</svg>
5146

52-
{getLayout(
53-
<>
54-
<Component {...pageProps} />
55-
<GoogleAnalytics gaId="G-JEQ15MLV6B" />
56-
</>,
57-
)}
47+
{getLayout(<Component {...pageProps} />)}
5848
</>
5949
);
6050
}

pages/_document.tsx

+13-47
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,16 @@
1-
import type { DocumentContext, DocumentInitialProps } from "next/document";
2-
import Document, { Head, Html, Main, NextScript } from "next/document";
3-
import Script from "next/script";
1+
import { GoogleAnalytics } from "@next/third-parties/google";
2+
import { Head, Html, Main, NextScript } from "next/document";
43

5-
class MyDocument extends Document {
6-
static async getInitialProps(
7-
ctx: DocumentContext,
8-
): Promise<DocumentInitialProps> {
9-
const initialProps = await Document.getInitialProps(ctx);
4+
export default function Document() {
5+
return (
6+
<Html lang="en">
7+
<Head />
8+
<body>
9+
<Main />
10+
<NextScript />
11+
</body>
1012

11-
return initialProps;
12-
}
13-
14-
render() {
15-
return (
16-
<Html lang="en">
17-
<Head>
18-
<link rel="preconnect" href="https://fonts.googleapis.com" />
19-
<link
20-
rel="preconnect"
21-
href="https://fonts.gstatic.com"
22-
crossOrigin=""
23-
/>
24-
<link
25-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=optional"
26-
rel="stylesheet"
27-
/>
28-
<link
29-
rel="stylesheet"
30-
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
31-
integrity="sha384-KiWOvVjnN8qwAZbuQyWDIbfCLFhLXNETzBQjA/92pIowpC0d2O3nppDGQVgwd2nB"
32-
crossOrigin="anonymous"
33-
/>
34-
</Head>
35-
<body>
36-
<Main />
37-
<NextScript />
38-
<Script
39-
defer
40-
data-domain="docs.tangle.tools"
41-
src="https://plausible.io/js/script.js"
42-
strategy="beforeInteractive"
43-
/>
44-
</body>
45-
</Html>
46-
);
47-
}
13+
<GoogleAnalytics gaId="G-JEQ15MLV6B" />
14+
</Html>
15+
);
4816
}
49-
50-
export default MyDocument;

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const config = {
22
plugins: {
3+
autoprefixer: {},
34
"tailwindcss/nesting": {},
45
tailwindcss: {},
5-
autoprefixer: {},
66
},
77
};
88

0 commit comments

Comments
 (0)