-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy paththeme.config.tsx
133 lines (122 loc) · 3.83 KB
/
theme.config.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import type { DocsThemeConfig } from 'nextra-theme-docs';
import React from 'react';
import { useRouter } from 'next/router';
import { useConfig } from 'nextra-theme-docs';
import { tvs, Logo, SmallLogo, LargeLogo } from '@components';
import pkg from './package.json';
const DEFAULT_VERSION = '0.1.14';
const getVersion = () => {
return (
pkg?.dependencies?.['tailwind-variants']?.replace('^', '') ??
DEFAULT_VERSION
);
};
const config: DocsThemeConfig = {
darkMode: true,
nextThemes: {
defaultTheme: 'dark'
},
logo: (
<div className="flex items-center">
<Logo height={30} />
<b className="ml-1.5 hidden text-sm font-semibold sm:block sm:text-base">
Tailwind Variants
</b>
<span className={tvs.badge({ class: 'hidden sm:flex' })}>
v{getVersion()}
</span>
</div>
),
head: function useHead() {
const config = useConfig();
const description =
config.frontMatter.description ||
'The power of Tailwind combined with a first-class variant API.';
const image =
config.frontMatter.image || 'https://tailwind-variants.org/banner.png';
// || "https://assets.vercel.com/image/upload/v1572282926/swr/twitter-card.jpg";
return (
<>
{/* Favicons, meta */}
<link
href="/favicon/apple-touch-icon.png"
rel="apple-touch-icon"
sizes="180x180"
/>
<link
href="/favicon/favicon-32x32.png"
rel="icon"
sizes="32x32"
type="image/png"
/>
<link
href="/favicon/favicon-16x16.png"
rel="icon"
sizes="16x16"
type="image/png"
/>
<link href="/favicon/site.webmanifest" rel="manifest" />
<link
color="#000000"
href="/favicon/safari-pinned-tab.svg"
rel="mask-icon"
/>
<meta content="#ffffff" name="msapplication-TileColor" />
<meta content="en" httpEquiv="Content-Language" />
<meta content={description} name="description" />
<meta content={description} name="og:description" />
<meta content="summary_large_image" name="twitter:card" />
<meta content="@hero_ui" name="twitter:site" />
<meta content={image} name="twitter:image" />
<meta content={`${config.title} – tailwind-variants`} name="og:title" />
<meta content={image} name="og:image" />
<meta content="tailwind-variants" name="apple-mobile-web-app-title" />
</>
);
},
useNextSeoProps: function SEO() {
const router = useRouter();
const { frontMatter } = useConfig();
const defaultTitle = frontMatter.overrideTitle || 'Tailwind Variants';
return {
description: frontMatter.description,
defaultTitle,
titleTemplate: router.pathname !== '/' ? `%s – ${defaultTitle}` : ''
};
},
project: {
link: 'https://github.com/heroui-inc/tailwind-variants'
},
chat: {
link: 'https://discord.gg/9b6yyZKmH4'
},
docsRepositoryBase:
'https://github.com/heroui-inc/tailwind-variants-docs/blob/main',
gitTimestamp: '',
sidebar: {
defaultMenuCollapseLevel: 1
},
footer: {
text: (
<div className="flex w-full flex-col items-center sm:items-start">
<div>
<a
className="flex items-center gap-1 text-current"
href="https://www.heroui.com/?utm_source=tailwind-variants.org"
rel="noopener noreferrer"
target="_blank"
title="heroui homepage"
>
<span className="mr-1">Powered by</span>
<SmallLogo className="h-6 w-6 md:hidden" />
<LargeLogo className="h-5 md:h-6" />
</a>
</div>
<p className="mt-6 text-xs">
MIT {new Date().getFullYear()} The Tailwind Variants Project.
</p>
</div>
)
}
};
export default config;