Skip to content

Commit f60f411

Browse files
committed
feat: logo link and analytics
1 parent 08f02ae commit f60f411

File tree

2 files changed

+49
-56
lines changed

2 files changed

+49
-56
lines changed

.vitepress/config.mts

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from 'vitepress';
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
5-
title: "RustFS",
6-
description: "RustFS is a high-performance distributed object storage software built using Rust",
5+
title: 'RustFS',
6+
description: 'RustFS is a high-performance distributed object storage software built using Rust',
77
themeConfig: {
88
siteTitle: false,
99
logo: { src: '/images/logo.svg', height: 24 },
10+
logoLink: { link: 'https://rustfs.com', target: '_blank' },
1011
socialLinks: [
1112
{ icon: 'github', link: 'https://github.com/rustfs/rustfs' },
1213
{ icon: 'twitter', link: 'https://twitter.com/rustfsofficial' },
@@ -20,28 +21,54 @@ export default defineConfig({
2021
translations: {
2122
button: {
2223
buttonText: '搜索文档',
23-
buttonAriaLabel: '搜索文档'
24+
buttonAriaLabel: '搜索文档',
2425
},
2526
modal: {
2627
noResultsText: '无法找到相关结果',
2728
resetButtonTitle: '清除查询条件',
2829
footer: {
2930
selectText: '选择',
30-
navigateText: '切换'
31-
}
32-
}
33-
}
34-
}
35-
}
36-
}
37-
}
31+
navigateText: '切换',
32+
},
33+
},
34+
},
35+
},
36+
},
37+
},
38+
},
3839
},
40+
head: [
41+
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-TWW7WMTWL9' }],
42+
43+
[
44+
'script',
45+
{},
46+
`window.dataLayer = window.dataLayer || [];
47+
function gtag(){dataLayer.push(arguments);}
48+
gtag('js', new Date());
49+
gtag('config', 'G-TWW7WMTWL9');`,
50+
],
51+
52+
[
53+
'script',
54+
{},
55+
`
56+
var _hmt = _hmt || [];
57+
(function() {
58+
var hm = document.createElement("script");
59+
hm.src = "https://hm.baidu.com/hm.js?968e7103a8e28fb30f7d69e42b7c82bc";
60+
var s = document.getElementsByTagName("script")[0];
61+
s.parentNode.insertBefore(hm, s);
62+
})();
63+
`,
64+
],
65+
],
3966
srcDir: 'docs',
4067
locales: {
4168
root: { label: 'English', link: '/en/', lang: 'en', dir: 'en' },
4269
zh: { label: '简体中文', link: '/zh/', lang: 'zh', dir: 'zh' },
4370
},
4471
sitemap: {
45-
hostname: 'https://docs.rustfs.com'
46-
}
47-
})
72+
hostname: 'https://docs.rustfs.com',
73+
},
74+
});

docs/config.ts

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineAdditionalConfig } from 'vitepress'
2-
import { enSidebar } from './en/sidebar'
1+
import { defineAdditionalConfig } from 'vitepress';
2+
import { enSidebar } from './en/sidebar';
33

44
export default defineAdditionalConfig({
55
lang: 'en-US',
@@ -21,46 +21,12 @@ export default defineAdditionalConfig({
2121

2222
editLink: {
2323
pattern: 'https://github.com/rustfs/rustfs/edit/main/docs/:path',
24-
text: 'Edit this page on GitHub'
24+
text: 'Edit this page on GitHub',
2525
},
2626

27-
head: [
28-
[
29-
'script',
30-
{ async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-TWW7WMTWL9' }
31-
],
32-
33-
[
34-
'script',
35-
{},
36-
`window.dataLayer = window.dataLayer || [];
37-
function gtag(){dataLayer.push(arguments);}
38-
gtag('js', new Date());
39-
gtag('config', 'G-TWW7WMTWL9');`
40-
],
41-
42-
['script', {}, `
43-
var _hmt = _hmt || [];
44-
(function() {
45-
var hm = document.createElement("script");
46-
hm.src = "https://hm.baidu.com/hm.js?968e7103a8e28fb30f7d69e42b7c82bc";
47-
var s = document.getElementsByTagName("script")[0];
48-
s.parentNode.insertBefore(hm, s);
49-
})();
50-
`]
51-
],
52-
53-
54-
55-
56-
5727
footer: {
5828
message: 'Released under the Apache License 2.0.',
59-
copyright: 'Copyright © 2025 RustFS'
60-
}
61-
}
62-
})
63-
64-
65-
66-
29+
copyright: 'Copyright © 2025 RustFS',
30+
},
31+
},
32+
});

0 commit comments

Comments
 (0)