Skip to content

Commit fc95026

Browse files
authored
feat(layout): add github link in navbar (#77)
1 parent 7bdd046 commit fc95026

File tree

6 files changed

+81
-23
lines changed

6 files changed

+81
-23
lines changed

.prettierrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"printWidth": 150,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"proseWrap": "preserve",
8+
"arrowParens": "avoid",
9+
"bracketSpacing": true,
10+
"disableLanguages": [],
11+
"endOfLine": "auto",
12+
"eslintIntegration": false,
13+
"htmlWhitespaceSensitivity": "ignore",
14+
"ignorePath": ".prettierignore",
15+
"requireConfig": false,
16+
"stylelintIntegration": false,
17+
"trailingComma": "es5",
18+
"tslintIntegration": false
19+
}

docs/.vitepress/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ export default (async () => ({
3737
copyright: '©Copyright 2022 Greptime Inc. All Rights Reserved',
3838
3939
sidebar: await makeSidebar(),
40+
socialLinks: [
41+
{
42+
icon: 'github',
43+
link: 'https://github.com/GreptimeTeam/docs',
44+
},
45+
],
4046
nav: [
4147
{
4248
text: 'Home',

docs/.vitepress/theme/default/components/VPNavBarExtra.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const hasExtraContent = computed(() => theme.value.localeLinks || site.value.app
5050
}
5151
}
5252
53-
@media (min-width: 1280px) {
53+
@media (min-width: 960px) {
5454
.VPNavBarExtra {
5555
display: none;
5656
}

docs/.vitepress/theme/default/components/VPNavBarHamburger.vue

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,40 @@ defineEmits<{
4848
overflow: hidden;
4949
}
5050
51-
.VPNavBarHamburger:hover .top { top: 0; left: 0; transform: translateX(4px); }
52-
.VPNavBarHamburger:hover .middle { top: 6px; left: 0; transform: translateX(0); }
53-
.VPNavBarHamburger:hover .bottom { top: 12px; left: 0; transform: translateX(8px); }
51+
.VPNavBarHamburger:hover .top {
52+
top: 0;
53+
left: 0;
54+
transform: translateX(4px);
55+
}
56+
.VPNavBarHamburger:hover .middle {
57+
top: 6px;
58+
left: 0;
59+
transform: translateX(0);
60+
}
61+
.VPNavBarHamburger:hover .bottom {
62+
top: 12px;
63+
left: 0;
64+
transform: translateX(8px);
65+
}
5466
55-
.VPNavBarHamburger.active .top { top: 6px; transform: translateX(0) rotate(225deg); }
56-
.VPNavBarHamburger.active .middle { top: 6px; transform: translateX(16px); }
57-
.VPNavBarHamburger.active .bottom { top: 6px; transform: translateX(0) rotate(135deg); }
67+
.VPNavBarHamburger.active .top {
68+
top: 6px;
69+
transform: translateX(0) rotate(225deg);
70+
}
71+
.VPNavBarHamburger.active .middle {
72+
top: 6px;
73+
transform: translateX(16px);
74+
}
75+
.VPNavBarHamburger.active .bottom {
76+
top: 6px;
77+
transform: translateX(0) rotate(135deg);
78+
}
5879
5980
.VPNavBarHamburger.active:hover .top,
6081
.VPNavBarHamburger.active:hover .middle,
6182
.VPNavBarHamburger.active:hover .bottom {
6283
background-color: var(--vp-c-text-2);
63-
transition: top .25s, background-color .25s, transform .25s;
84+
transition: top 0.25s, background-color 0.25s, transform 0.25s;
6485
}
6586
6687
.top,
@@ -69,11 +90,23 @@ defineEmits<{
6990
position: absolute;
7091
width: 16px;
7192
height: 2px;
72-
background-color: var(--vp-c-text-1);
73-
transition: top .25s, background-color .5s, transform .25s;
93+
background-color: var(--vp-c-text-dark-1);
94+
transition: top 0.25s, background-color 0.5s, transform 0.25s;
7495
}
7596
76-
.top { top: 0; left: 0; transform: translateX(0); }
77-
.middle { top: 6px; left: 0; transform: translateX(8px); }
78-
.bottom { top: 12px; left: 0; transform: translateX(4px); }
97+
.top {
98+
top: 0;
99+
left: 0;
100+
transform: translateX(0);
101+
}
102+
.middle {
103+
top: 6px;
104+
left: 0;
105+
transform: translateX(8px);
106+
}
107+
.bottom {
108+
top: 12px;
109+
left: 0;
110+
transform: translateX(4px);
111+
}
79112
</style>

docs/.vitepress/theme/default/components/VPNavBarSocialLinks.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ const { theme } = useData()
66
</script>
77

88
<template>
9-
<VPSocialLinks
10-
v-if="theme.socialLinks"
11-
class="VPNavBarSocialLinks"
12-
:links="theme.socialLinks"
13-
/>
9+
<VPSocialLinks v-if="theme.socialLinks" class="VPNavBarSocialLinks" :links="theme.socialLinks" />
1410
</template>
1511

1612
<style scoped>
1713
.VPNavBarSocialLinks {
1814
display: none;
1915
}
2016
21-
@media (min-width: 1280px) {
17+
@media (min-width: 960px) {
2218
.VPNavBarSocialLinks {
2319
display: flex;
2420
align-items: center;

docs/.vitepress/theme/style/custom.styl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ body {
3030
margin-bottom: -80px;
3131
}
3232

33-
.VPNavBarHamburger {
34-
display: none !important;
35-
}
36-
3733
.VPNavBarTitle, .dark .VPNavBar.has-sidebar .content {
3834
background-color: transparent !important;
3935
}
@@ -86,3 +82,11 @@ body {
8682
line-height: 30px;
8783
opacity: 0.6;
8884
}
85+
86+
.VPNavScreen .VPSocialLink {
87+
color var(--vp-c-text-2) !important
88+
}
89+
90+
.VPSocialLink {
91+
color #fff !important
92+
}

0 commit comments

Comments
 (0)