Skip to content

Commit dade8f9

Browse files
committed
internatinalise
1 parent d7ddf80 commit dade8f9

File tree

10 files changed

+209
-37
lines changed

10 files changed

+209
-37
lines changed

docs/.vitepress/config.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress'
1+
import {defineConfig, HeadConfig} from 'vitepress'
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
@@ -8,21 +8,32 @@ export default defineConfig({
88
// https://vitepress.dev/reference/default-theme-config
99
nav: [
1010
{ text: 'Home', link: '/' },
11-
{ text: 'Examples', link: '/markdown-examples' }
11+
{ text: 'Products', link: '/products' },
12+
{ text: 'Docs', link: '/docs' },
1213
],
1314

1415
sidebar: [
1516
{
16-
text: 'Examples',
17+
text: 'sidebar',
1718
items: [
18-
{ text: 'Markdown Examples', link: '/markdown-examples' },
19-
{ text: 'Runtime API Examples', link: '/api-examples' }
19+
{ text: 'Docs', link: '/docs' },
20+
{ text: 'Products', link: '/products' }
2021
]
2122
}
2223
],
2324

2425
socialLinks: [
25-
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
26+
{ icon: 'github', link: 'https://github.com/hostsless' }
2627
]
28+
},
29+
locales: {
30+
root: {
31+
label: 'English',
32+
lang: 'en',
33+
},
34+
zh: {
35+
label: '中文',
36+
lang: 'zh-CN',
37+
}
2738
}
2839
})

docs/.vitepress/theme/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import {inBrowser, useData} from "vitepress";
3+
import {watchEffect} from "vue";
4+
5+
export default {
6+
...DefaultTheme,
7+
setup() {
8+
const { lang } = useData()
9+
watchEffect(() => {
10+
if (inBrowser) {
11+
document.cookie = `nf_lang=${lang.value}; expires=Mon, 1 Jan 2024 00:00:00 UTC; path=/`
12+
}
13+
})
14+
}
15+
}
File renamed without changes.

docs/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ hero:
1010

1111
features:
1212
- title: storage
13-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
13+
details: Lorem ipsum dolor sit amet
1414
- title: compute
15-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
15+
details: Lorem ipsum dolor sit amet
16+
- title: gateway
17+
details: Lorem ipsum dolor sit amet
1618
- title: identity
17-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
19+
details: Lorem ipsum dolor sit amet
1820
- title: trust
19-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
21+
details: Lorem ipsum dolor sit amet
22+
- title: docsless
23+
details: Lorem ipsum dolor sit amet
2024
---
2125

File renamed without changes.

docs/zh/docs.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Markdown Extension Examples
2+
3+
This page demonstrates some of the built-in markdown extensions provided by VitePress.
4+
5+
## Syntax Highlighting
6+
7+
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8+
9+
**Input**
10+
11+
````
12+
```js{4}
13+
export default {
14+
data () {
15+
return {
16+
msg: 'Highlighted!'
17+
}
18+
}
19+
}
20+
```
21+
````
22+
23+
**Output**
24+
25+
```js{4}
26+
export default {
27+
data () {
28+
return {
29+
msg: 'Highlighted!'
30+
}
31+
}
32+
}
33+
```
34+
35+
## Custom Containers
36+
37+
**Input**
38+
39+
```md
40+
::: info
41+
This is an info box.
42+
:::
43+
44+
::: tip
45+
This is a tip.
46+
:::
47+
48+
::: warning
49+
This is a warning.
50+
:::
51+
52+
::: danger
53+
This is a dangerous warning.
54+
:::
55+
56+
::: details
57+
This is a details block.
58+
:::
59+
```
60+
61+
**Output**
62+
63+
::: info
64+
This is an info box.
65+
:::
66+
67+
::: tip
68+
This is a tip.
69+
:::
70+
71+
::: warning
72+
This is a warning.
73+
:::
74+
75+
::: danger
76+
This is a dangerous warning.
77+
:::
78+
79+
::: details
80+
This is a details block.
81+
:::
82+
83+
## More
84+
85+
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

docs/zh/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: 首页
4+
5+
hero:
6+
name: "hostsless"
7+
text: "build your business without any physical hosts concerns"
8+
tagline: hostsless the feature
9+
10+
11+
features:
12+
- title: 存储
13+
details: Lorem ipsum dolor sit amet
14+
- title: 计算
15+
details: Lorem ipsum dolor sit amet
16+
- title: 访问控制
17+
details: Lorem ipsum dolor sit amet
18+
- title: 信任
19+
details: Lorem ipsum dolor sit amet
20+
- title: 网关
21+
details: Lorem ipsum dolor sit amet
22+
---
23+

docs/zh/products.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
<pre>{{ theme }}</pre>
22+
23+
### Page Data
24+
<pre>{{ page }}</pre>
25+
26+
### Page Frontmatter
27+
<pre>{{ frontmatter }}</pre>
28+
```
29+
30+
<script setup>
31+
import { useData } from 'vitepress'
32+
33+
const { site, theme, page, frontmatter } = useData()
34+
</script>
35+
36+
## Results
37+
38+
### Theme Data
39+
<pre>{{ theme }}</pre>
40+
41+
### Page Data
42+
<pre>{{ page }}</pre>
43+
44+
### Page Frontmatter
45+
<pre>{{ frontmatter }}</pre>
46+
47+
## More
48+
49+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

0 commit comments

Comments
 (0)