Skip to content

Commit 0ce17e8

Browse files
committed
update theme.config.tsx and README.md
1 parent 44d531f commit 0ce17e8

3 files changed

Lines changed: 82 additions & 16 deletions

File tree

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
# Nextra Docs Template
1+
## ABOUT
22

3-
This is a template for creating documentation with [Nextra](https://nextra.site).
4-
5-
[**Live Demo →**](https://nextra-docs-template.vercel.app)
6-
7-
[![](.github/screenshot.png)](https://nextra-docs-template.vercel.app)
8-
9-
## Quick Start
10-
11-
Click the button to clone this repository and deploy it on Vercel:
12-
13-
[![](https://vercel.com/button)](https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fshuding%2Fnextra-docs-template&showOptionalTeamCreation=false)
3+
This is docs to VZN Scripts assets
144

155
## Local Development
166

public/logo.png

29.3 KB
Loading

theme.config.tsx

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,91 @@
11
import React from "react";
2-
import { DocsThemeConfig } from "nextra-theme-docs";
2+
import { DocsThemeConfig, useConfig } from "nextra-theme-docs";
3+
import { useRouter } from "next/router";
34

45
const config: DocsThemeConfig = {
5-
logo: <span>My Project</span>,
6+
head: () => {
7+
const { asPath } = useRouter();
8+
const { frontMatter, title } = useConfig();
9+
const defaultDescription = "Documentation for VZN Scripts assets";
10+
const url = `https://docs.vzn-scripts.com/${asPath}`;
11+
12+
return (
13+
<>
14+
<link rel="icon" type="image/png" href="/logo.png" />
15+
16+
<meta httpEquiv="Content-Language" content="en" />
17+
<meta
18+
name="description"
19+
content={frontMatter.description || defaultDescription}
20+
/>
21+
<meta
22+
name="og:title"
23+
content={title || "VZN Scripts Documentation"}
24+
/>
25+
<meta name="og:url" content={url} />
26+
<meta
27+
name="og:description"
28+
content={frontMatter.description || defaultDescription}
29+
/>
30+
<meta
31+
name="viewport"
32+
content="width=device-width, initial-scale=1.0"
33+
/>
34+
</>
35+
);
36+
},
37+
logo: (
38+
<div
39+
style={{
40+
display: "flex",
41+
alignItems: "center",
42+
gap: "5px",
43+
}}
44+
>
45+
<div
46+
style={{
47+
width: "38px",
48+
height: "38px",
49+
background:
50+
"url('https://avatars.githubusercontent.com/u/175264237?s=38') no-repeat left",
51+
backgroundSize: "38px",
52+
borderRadius: "50%",
53+
}}
54+
></div>
55+
<span
56+
style={{
57+
fontWeight: 550,
58+
lineHeight: "38px",
59+
}}
60+
></span>
61+
VZN Scripts
62+
</div>
63+
),
64+
useNextSeoProps: () => {
65+
// credits for overextended for this function
66+
const { asPath } = useRouter();
67+
const arr = asPath.replace(/[-_]/g, " ").split("/");
68+
const category = (arr[1][0] !== "#" && arr[1]) || "VZN Scripts";
69+
const rawTitle = arr[arr.length - 1];
70+
const title =
71+
/[a-z]/.test(rawTitle) && /[A-Z]/.test(rawTitle) ? rawTitle : "%s";
72+
73+
return {
74+
titleTemplate: `${title} | ${
75+
rawTitle === category
76+
? "Documentation"
77+
: category.replace(/(^\w|\s\w)/g, (m) => m.toUpperCase())
78+
}`,
79+
};
80+
},
681
project: {
7-
link: "https://github.com/VZN-Scripts/docs",
82+
link: "https://github.com/VZN-Scripts",
883
},
984
chat: {
1085
link: "https://discord.gg/wqzrVM3QYk",
1186
},
12-
docsRepositoryBase: "https://github.com/VZN-Scripts/docs/blob/main",
87+
docsRepositoryBase:
88+
"https://github.com/VZN-Scripts/vzn-scripts.github.io/blob/main",
1389
footer: {
1490
text: "VZN Scripts",
1591
},

0 commit comments

Comments
 (0)