Skip to content

Commit d0e6778

Browse files
committed
feat: add sitemap and improve typography for selfhosting
1 parent e383a71 commit d0e6778

29 files changed

+2329
-2300
lines changed

app.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
</NuxtLayout>
1717
</div>
1818
</template>
19-
20-
<script>
21-
import '@fontsource/ibm-plex-mono';
22-
import '@fontsource/dm-sans';
23-
</script>
19+
<style>
20+
@import url('@/styles/typography/all.css');
21+
</style>
30.8 KB
Binary file not shown.
30.7 KB
Binary file not shown.
30.7 KB
Binary file not shown.
17.7 KB
Binary file not shown.
17.8 KB
Binary file not shown.
17.8 KB
Binary file not shown.
10.7 KB
Binary file not shown.
10.6 KB
Binary file not shown.
10.6 KB
Binary file not shown.
17.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

components/home/features.server.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
font-size="1.8em"
3535
:as="feature.icon"
3636
/>
37-
<chakra.h3
37+
<chakra.h2
3838
:color="useColorModeValue('emerald.600', 'white').value"
3939
font-weight="bold"
4040
font-size="1.1rem"
4141
>
4242
{{ feature.title }}
43-
</chakra.h3>
43+
</chakra.h2>
4444
<chakra.p>
4545
{{ feature.description }}
4646
</chakra.p>

config/site-config.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
const baseUrl = 'https://github.com/chakra-ui/chakra-ui-vue-next'
1+
const baseUrl = 'https://github.com/chakra-ui/chakra-ui-vue-next';
22

3-
const siteUrl = 'https://vue.chakra-ui.com'
3+
const siteUrl = 'https://vue.chakra-ui.com';
44
const siteDescription =
5-
'Simple, Modular and Accessible UI Components for your Vue Applications.'
6-
const siteName =
7-
'Chakra UI Vue: Simple, Modular and Accessible UI Components for your Vue Applications.'
8-
const siteLang = 'en'
5+
'Simple, Modular and Accessible UI Components for your Vue Applications.';
6+
const siteName = 'Chakra UI Vue | Build accessible Vue apps with speed';
7+
const siteLang = 'en';
98

109
const siteConfig = {
1110
repo: {
@@ -52,7 +51,7 @@ const siteConfig = {
5251
]
5352
}
5453
}
55-
}
54+
};
5655

57-
export default siteConfig
58-
export { baseUrl, siteDescription, siteLang, siteName, siteUrl }
56+
export default siteConfig;
57+
export { baseUrl, siteDescription, siteLang, siteName, siteUrl };

content/2.styled-system/1.responsive-styles.md

Lines changed: 42 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const breakpoints = {
2222
md: '48em', // 768px
2323
lg: '62em', // 992px
2424
xl: '80em', // 1280px
25-
'2xl': '96em', // 1536px
26-
}
25+
'2xl': '96em' // 1536px
26+
};
2727
```
2828

2929
To make styles responsive, you can use either the array or object syntax.
@@ -35,19 +35,15 @@ is the recommended method.
3535

3636
Let's say you have a `CBox` with the following properties:
3737

38-
```vue
39-
<c-box bg='red.200' w='400px'>
40-
This is a box
41-
</c-box>
38+
```html
39+
<c-box bg="red.200" w="400px"> This is a box </c-box>
4240
```
4341

4442
To make the `width` or `w` responsive using the array syntax, here's what you
4543
need to do:
4644

47-
```vue
48-
<c-box bg='red.200' :w='[300, 400, 500]'>
49-
This is a box
50-
</c-box>
45+
```html
46+
<c-box bg="red.200" :w="[300, 400, 500]"> This is a box </c-box>
5147
```
5248

5349
To interpret array responsive values, Chakra UI Vue converts the values defined in
@@ -61,11 +57,11 @@ const breakpoints = {
6157
md: '48em', // 768px
6258
lg: '62em', // 992px
6359
xl: '80em', // 1280px
64-
'2xl': '96em', // 1536px
65-
}
60+
'2xl': '96em' // 1536px
61+
};
6662

6763
// Internally, we transform to this
68-
const breakpoints = ['0em', '30em', '48em', '62em', '80em', '96em']
64+
const breakpoints = ['0em', '30em', '48em', '62em', '80em', '96em'];
6965
```
7066

7167
Here's how to interpret this syntax:
@@ -84,14 +80,14 @@ undefined alias key will define the base, non-responsive value.
8480

8581
Let's say you have a `CText` that looks like this:
8682

87-
```vue
88-
<c-text fontSize='40px'>This is a text</c-text>
83+
```html
84+
<c-text fontSize="40px">This is a text</c-text>
8985
```
9086

9187
To make the `fontSize` responsive using the object syntax, here's what you need
9288
to do:
9389

94-
```vue
90+
```html
9591
<c-text :fontSize="{ base: '24px', md: '40px', lg: '56px' }">
9692
This is responsive text
9793
</c-text>
@@ -111,15 +107,15 @@ Here's how to interpret this syntax:
111107
This works for every style prop in the theme specification, which means you can
112108
change the style of most properties at a given breakpoint.
113109

114-
```vue
110+
```html
115111
<div>
116112
<c-box
117113
:height="{
118114
base: '100%', // 0-48em
119115
md: '50%', // 48em-80em,
120116
xl: '25%', // 80em+
121117
}"
122-
bg='teal.400'
118+
bg="teal.400"
123119
:width="[
124120
'100%', // 0-30em
125121
'50%', // 30em-48em
@@ -130,11 +126,9 @@ change the style of most properties at a given breakpoint.
130126
{/* responsive font size */}
131127
<c-box :fontSize="['sm', 'md', 'lg', 'xl']">Font Size</c-box>
132128
{/* responsive margin */}
133-
<c-box :mt="[2, 4, 6, 8]" width='full' height='24px' bg='tomato' />
129+
<c-box :mt="[2, 4, 6, 8]" width="full" height="24px" bg="tomato" />
134130
{/* responsive padding */}
135-
<c-box bg='papayawhip' :p="[2, 4, 6, 8]">
136-
Padding
137-
</c-box>
131+
<c-box bg="papayawhip" :p="[2, 4, 6, 8]"> Padding </c-box>
138132
</div>
139133
```
140134

@@ -143,7 +137,7 @@ change the style of most properties at a given breakpoint.
143137
This shortcut is an alternative to writing media queries out by hand. Given the
144138
following:
145139

146-
```vue
140+
```html
147141
<c-box :width="[1, 1 / 2, 1 / 4]" />
148142
```
149143

@@ -180,23 +174,12 @@ To define custom breakpoints, just pass them as an object into the theme.
180174
> Note: Ensure the css unit of your breakpoints are the same. Use all `px` or
181175
> all `em`, don't mix them.
182176
183-
```vue
184-
// 1. Import the utilities
185-
import { extendTheme } from '@chakra-ui/vue-next'
186-
187-
// 2. Update the breakpoints as key-value pairs
188-
const breakpoints = {
189-
sm: '320px',
190-
md: '768px',
191-
lg: '960px',
192-
xl: '1200px',
193-
'2xl': '1536px',
194-
}
195-
196-
// 3. Extend the theme
197-
const theme = extendTheme({ breakpoints })
198-
199-
// 4. Now you can use the custom breakpoints
177+
```html
178+
// 1. Import the utilities import { extendTheme } from '@chakra-ui/vue-next' //
179+
2. Update the breakpoints as key-value pairs const breakpoints = { sm: '320px',
180+
md: '768px', lg: '960px', xl: '1200px', '2xl': '1536px', } // 3. Extend the
181+
theme const theme = extendTheme({ breakpoints }) // 4. Now you can use the
182+
custom breakpoints
200183
<template>
201184
<c-box :width="{ base: '100%', sm: '50%', md: '25%' }" />
202185
</template>
@@ -212,40 +195,40 @@ Here's a simple example of a marketing page component that uses a stacked layout
212195
on small screens, and a side-by-side layout on larger screens **(resize your
213196
browser to see it in action)**:
214197

215-
```vue
216-
<c-box p='4' :display="{ md: 'flex' }">
217-
<c-box flexShrink='0'>
198+
```html
199+
<c-box p="4" :display="{ md: 'flex' }">
200+
<c-box flexShrink="0">
218201
<c-image
219-
borderRadius='lg'
202+
borderRadius="lg"
220203
:width="{ md: 40 }"
221-
src='https://bit.ly/2jYM25F'
222-
alt='Woman paying for a purchase'
204+
src="https://bit.ly/2jYM25F"
205+
alt="Woman paying for a purchase"
223206
/>
224207
</c-box>
225208
<c-box :mt="{ base: 4, md: 0 }" :ml="{ md: 6 }">
226209
<c-text
227-
fontWeight='bold'
228-
textTransform='uppercase'
229-
fontSize='sm'
230-
letterSpacing='wide'
231-
color='teal.600'
210+
fontWeight="bold"
211+
textTransform="uppercase"
212+
fontSize="sm"
213+
letterSpacing="wide"
214+
color="teal.600"
232215
>
233216
Marketing
234217
</c-text>
235218
<c-link
236-
mt='1'
237-
display='block'
238-
fontSize='lg'
239-
lineHeight='normal'
240-
fontWeight='semibold'
241-
href='#'
219+
mt="1"
220+
display="block"
221+
fontSize="lg"
222+
lineHeight="normal"
223+
fontWeight="semibold"
224+
href="#"
242225
>
243226
Finding customers for your new business
244227
</c-link>
245-
<c-text mt='2' color='gray.500'>
228+
<c-text mt="2" color="gray.500">
246229
Getting a new business off the ground is a lot of hard work. Here are five
247230
ideas you can use to find your first customers.
248231
</c-text>
249232
</c-box>
250233
</c-box>
251-
```
234+
```

nuxt.config.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ export default defineNuxtConfig({
1111
prerender: {
1212
routes: [
1313
'/',
14-
'/getting-started',
14+
'/getting-started/**/*',
15+
'/styled-system/**/*',
16+
'/components/**/*',
17+
'/sitemap.xml'
1518
]
1619
},
17-
serveStatic: true,
20+
serveStatic: true
1821
},
1922
app: {
2023
head: {
@@ -39,10 +42,21 @@ export default defineNuxtConfig({
3942
modules: [
4043
'@nuxt/content',
4144
'~/modules/content-chunks.module.ts',
42-
'@chakra-ui/nuxt-next'
45+
'@chakra-ui/nuxt-next',
46+
'@nuxtjs/fontaine',
47+
'@nuxtjs/html-validator',
48+
'@nuxtjs/robots'
4349
],
44-
plugins: ['~/plugins/typography.ts'],
45-
css: ['~/styles/fonts.scss', '~/styles/prism.scss'],
50+
fontMetrics: {
51+
fonts: [
52+
'DM Sans',
53+
{
54+
family: 'DM Sans',
55+
src: '@/styles/typography/files/dm-sans-all-400-normal.woff2'
56+
}
57+
]
58+
},
59+
css: ['@/styles/typography/all.css', '~/styles/prism.scss'],
4660
content: {
4761
// documentDriven: true,
4862
markdown: {

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
"@commitlint/config-conventional": "^17.3.0",
2222
"@nuxt/content": "^2.4.3",
2323
"@nuxtjs/eslint-config-typescript": "^12.0.0",
24+
"@nuxtjs/fontaine": "^0.2.5",
25+
"@nuxtjs/html-validator": "^1.2.5",
2426
"@typescript-eslint/parser": "^5.47.0",
2527
"add": "^2.0.6",
2628
"eslint": "^8.30.0",
2729
"eslint-config-prettier": "^8.5.0",
2830
"eslint-plugin-prettier": "^4.2.1",
2931
"eslint-plugin-vue": "^9.8.0",
3032
"husky": "^8.0.2",
31-
"nuxt": "^3.3.1",
33+
"nuxt": "^3.4.2",
3234
"prettier": "^2.8.1",
3335
"typescript": "^4.9.4"
3436
},
@@ -41,6 +43,7 @@
4143
"@fontsource/ibm-plex-mono": "^4.5.13",
4244
"@nuxt/vite-builder": "^3.0.0",
4345
"@nuxtjs/color-mode": "^3.2.0",
46+
"@nuxtjs/robots": "^3.0.0",
4447
"@types/prismjs": "^1.26.0",
4548
"@vueuse/core": "^9.13.0",
4649
"add": "^2.0.6",
@@ -51,6 +54,7 @@
5154
"rehype-prism-plus": "^1.5.0",
5255
"remark-prism": "^1.3.6",
5356
"sass": "^1.56.2",
57+
"sitemap": "^7.1.1",
5458
"slugify": "^1.6.5",
5559
"unplugin-vue-components": "^0.24.0",
5660
"vue": "^3.2.47",

plugins/typography.ts

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

0 commit comments

Comments
 (0)