cob-cli 2.12.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/customizations/backend.js +1 -0
- package/customizations/backend.vuepress.js +35 -0
- package/customizations/frontend.js +1 -0
- package/lib/task_lists/test_otherFilesContiousReload.js +1 -1
- package/package.json +5 -1
- package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +74 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +42 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +17 -0
- package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +619 -0
- package/templates/backend/vuepress/others/vuepress/nginx/README.md +28 -0
- package/templates/backend/vuepress/others/vuepress/package-lock.json +29656 -0
- package/templates/backend/vuepress/others/vuepress/package.json +24 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +124 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +26 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +228 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +77 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +101 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +14 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +52 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +96 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +39 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +17 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +21 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +11 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +172 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +252 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +33 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +134 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +98 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +165 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +119 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +163 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +64 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +40 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +144 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +114 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +41 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +120 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +59 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +30 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +151 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +137 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +202 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +37 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +3 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +10 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +244 -0
- package/templates/dashboards/dash/definition_dashboard_v59.json +1 -0
- package/templates/dashboards/dash/dist/dashboard.html +8 -3
- package/templates/dashboards/dash/dist/js/{app.a65a4c2c.js → app.8423eff3.js} +2 -2
- package/templates/dashboards/dash/dist/js/app.8423eff3.js.map +1 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js +188 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js.map +1 -0
- package/templates/dashboards/dash/src/App.vue +32 -212
- package/templates/dashboards/dash/src/Dashboard.vue +31 -11
- package/templates/dashboards/dash/src/collector.js +35 -3694
- package/templates/dashboards/dash/src/components/Menu.vue +15 -4
- package/templates/dashboards/dash/src/components/Title.vue +10 -2
- package/templates/dashboards/dash/src/components/Totals.vue +19 -9
- package/templates/dashboards/dash/src/components/{TotalsBadge.vue → TotalsValue.vue} +12 -12
- package/templates/dashboards/dash/src/dashboard.html +6 -1
- package/templates/dashboards/dash/src/test_collector.js +3732 -0
- package/templates/dashboards/dash/dist/js/app.a65a4c2c.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition
|
|
3
|
+
name="dropdown"
|
|
4
|
+
@enter="setHeight"
|
|
5
|
+
@after-enter="unsetHeight"
|
|
6
|
+
@before-leave="setHeight"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</transition>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: 'DropdownTransition',
|
|
15
|
+
|
|
16
|
+
methods: {
|
|
17
|
+
setHeight (items) {
|
|
18
|
+
// explicitly set height so that it can be transitioned
|
|
19
|
+
items.style.height = items.scrollHeight + 'px'
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
unsetHeight (items) {
|
|
23
|
+
items.style.height = ''
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="stylus">
|
|
30
|
+
.dropdown-enter, .dropdown-leave-to
|
|
31
|
+
height 0 !important
|
|
32
|
+
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="home">
|
|
3
|
+
<div>
|
|
4
|
+
<div :class="['headline',{ normalWidth: normalWidth }]">
|
|
5
|
+
<img class="headlineImg" src="/docs/Logo-Cult-of-Bits-400x400-1.png">
|
|
6
|
+
<div class="headlineLeft">
|
|
7
|
+
<span :style="{fontSize: $frontmatter.verbFontSize}">
|
|
8
|
+
{{$frontmatter.verb}}
|
|
9
|
+
</span>
|
|
10
|
+
<br>
|
|
11
|
+
<span>
|
|
12
|
+
Cult of Bits
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div :class="['line', { normalWidth: normalWidth }]"/>
|
|
16
|
+
<div :class="['headlineRight',{ normalWidth: normalWidth }]">
|
|
17
|
+
{{$frontmatter.lines[0]}}
|
|
18
|
+
<br>
|
|
19
|
+
<b>{{$frontmatter.lines[1]}}</b>
|
|
20
|
+
<br>
|
|
21
|
+
<i style="font-size:0.85em">
|
|
22
|
+
{{$frontmatter.lines[2]}}
|
|
23
|
+
</i>
|
|
24
|
+
<br>
|
|
25
|
+
{{$frontmatter.lines[3]}}
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<Content class="theme-default-content custom" />
|
|
31
|
+
|
|
32
|
+
<div
|
|
33
|
+
class="footer"
|
|
34
|
+
v-if="$frontmatter.footer"
|
|
35
|
+
v-html="$frontmatter.footer"
|
|
36
|
+
/>
|
|
37
|
+
</main>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
export default {
|
|
42
|
+
name: 'Home',
|
|
43
|
+
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
windowWidth: 1000
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
mounted() {
|
|
50
|
+
this.windowWidth = window.innerWidth
|
|
51
|
+
window.onresize = () => this.windowWidth = window.innerWidth
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
normalWidth() {
|
|
55
|
+
return this.windowWidth > this.$frontmatter.breakMediaMinWidth
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="stylus">
|
|
62
|
+
.home
|
|
63
|
+
max-width: 50em;
|
|
64
|
+
margin: 3em auto -2em auto;
|
|
65
|
+
padding: 35px;
|
|
66
|
+
.headline
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 20px;
|
|
71
|
+
margin-bottom 2.5rem
|
|
72
|
+
justify-content: center;
|
|
73
|
+
.headlineImg
|
|
74
|
+
width: 100px;
|
|
75
|
+
.headlineLeft
|
|
76
|
+
font-size: 4em;
|
|
77
|
+
text-align: center
|
|
78
|
+
@media (max-width: 438px)
|
|
79
|
+
font-size: 3em;
|
|
80
|
+
margin-top: 10px;
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
color: $accentColor;
|
|
83
|
+
min-width:300px;
|
|
84
|
+
line-height: 0.9em;
|
|
85
|
+
.headlineRight
|
|
86
|
+
text-align: center;
|
|
87
|
+
font-size: 1.3em
|
|
88
|
+
margin-top:20px;
|
|
89
|
+
color: #50585D;
|
|
90
|
+
.line
|
|
91
|
+
border-left: solid 1px white;
|
|
92
|
+
@media (max-width: 438px)
|
|
93
|
+
display: none
|
|
94
|
+
&.normalWidth
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
.line
|
|
97
|
+
height: 130px;
|
|
98
|
+
margin-top: 24px;
|
|
99
|
+
border-left: solid 1px gray;
|
|
100
|
+
.headlineLeft
|
|
101
|
+
font-size: 4em;
|
|
102
|
+
.headlineRight
|
|
103
|
+
text-align:left;
|
|
104
|
+
.theme-default-content.custom.content__default
|
|
105
|
+
p
|
|
106
|
+
text-align: justify;
|
|
107
|
+
color: #777;
|
|
108
|
+
|
|
109
|
+
.footer
|
|
110
|
+
font-size: 0.8em
|
|
111
|
+
color lighten($textColor, 25%)
|
|
112
|
+
padding: 1rem 0;
|
|
113
|
+
text-align: center;
|
|
114
|
+
border-top 1px solid $borderColor
|
|
115
|
+
margin-top: 3em;
|
|
116
|
+
|
|
117
|
+
// Embrace nav menu 'Solutions' in |
|
|
118
|
+
@media (min-width: $MQMobile)
|
|
119
|
+
.nav-item >a.nav-link[href*="/solutions/"]
|
|
120
|
+
border-left: 2px solid
|
|
121
|
+
border-right: 2px solid
|
|
122
|
+
padding-left: 15px
|
|
123
|
+
padding-right: 15px
|
|
124
|
+
&.cob-router-link-active
|
|
125
|
+
&:hover
|
|
126
|
+
border-bottom: unset
|
|
127
|
+
&:before
|
|
128
|
+
content: "";
|
|
129
|
+
position: absolute;
|
|
130
|
+
height: 12px;
|
|
131
|
+
bottom: 4px;
|
|
132
|
+
width: 70%;
|
|
133
|
+
border-bottom: 2px solid #f90049;
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RouterLink
|
|
3
|
+
v-if="isInternal"
|
|
4
|
+
class="nav-link"
|
|
5
|
+
:class="{ 'cob-router-link-active': isActive }"
|
|
6
|
+
:to="link"
|
|
7
|
+
:exact="exact"
|
|
8
|
+
@focusout.native="focusoutAction"
|
|
9
|
+
>
|
|
10
|
+
{{ item.text }}
|
|
11
|
+
</RouterLink>
|
|
12
|
+
<a
|
|
13
|
+
v-else
|
|
14
|
+
:href="link"
|
|
15
|
+
class="nav-link external"
|
|
16
|
+
:target="target"
|
|
17
|
+
:rel="rel"
|
|
18
|
+
@focusout="focusoutAction"
|
|
19
|
+
>
|
|
20
|
+
{{ item.text }}
|
|
21
|
+
<OutboundLink v-if="isBlankTarget" />
|
|
22
|
+
</a>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import { isExternal, isMailto, isTel, ensureExt } from '../util'
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'NavLink',
|
|
30
|
+
|
|
31
|
+
props: {
|
|
32
|
+
item: {
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
computed: {
|
|
38
|
+
link () {
|
|
39
|
+
return ensureExt(this.item.link)
|
|
40
|
+
},
|
|
41
|
+
isActive () {
|
|
42
|
+
if(this.$frontmatter.target) {
|
|
43
|
+
return this.link.indexOf("/" + this.$frontmatter.target.toLowerCase() + "s/") >= 0
|
|
44
|
+
} else {
|
|
45
|
+
return false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
exact () {
|
|
50
|
+
if (this.$site.locales) {
|
|
51
|
+
return Object.keys(this.$site.locales).some(rootLink => rootLink === this.link)
|
|
52
|
+
}
|
|
53
|
+
return this.link === '/'
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
isNonHttpURI () {
|
|
57
|
+
return isMailto(this.link) || isTel(this.link)
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
isBlankTarget () {
|
|
61
|
+
return this.target === '_blank'
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
isInternal () {
|
|
65
|
+
return !isExternal(this.link) && !this.isBlankTarget
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
target () {
|
|
69
|
+
if (this.isNonHttpURI) {
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
if (this.item.target) {
|
|
73
|
+
return this.item.target
|
|
74
|
+
}
|
|
75
|
+
return isExternal(this.link) ? '_blank' : ''
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
rel () {
|
|
79
|
+
if (this.isNonHttpURI) {
|
|
80
|
+
return null
|
|
81
|
+
}
|
|
82
|
+
if (this.item.rel === false) {
|
|
83
|
+
return null
|
|
84
|
+
}
|
|
85
|
+
if (this.item.rel) {
|
|
86
|
+
return this.item.rel
|
|
87
|
+
}
|
|
88
|
+
return this.isBlankTarget ? 'noopener noreferrer' : null
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
methods: {
|
|
93
|
+
focusoutAction () {
|
|
94
|
+
this.$emit('focusout')
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</script>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav
|
|
3
|
+
v-if="userLinks.length || repoLink"
|
|
4
|
+
class="nav-links"
|
|
5
|
+
>
|
|
6
|
+
<!-- user links -->
|
|
7
|
+
<div
|
|
8
|
+
v-for="item in userLinks"
|
|
9
|
+
:key="item.link"
|
|
10
|
+
class="nav-item"
|
|
11
|
+
>
|
|
12
|
+
<DropdownLink
|
|
13
|
+
v-if="item.type === 'links'"
|
|
14
|
+
:item="item"
|
|
15
|
+
/>
|
|
16
|
+
<NavLink
|
|
17
|
+
v-else
|
|
18
|
+
:item="item"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- repo link -->
|
|
23
|
+
<a
|
|
24
|
+
v-if="repoLink"
|
|
25
|
+
:href="repoLink"
|
|
26
|
+
class="repo-link"
|
|
27
|
+
target="_blank"
|
|
28
|
+
rel="noopener noreferrer"
|
|
29
|
+
>
|
|
30
|
+
{{ repoLabel }}
|
|
31
|
+
<OutboundLink />
|
|
32
|
+
</a>
|
|
33
|
+
</nav>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import DropdownLink from '@theme/components/DropdownLink.vue'
|
|
38
|
+
import { resolveNavLinkItem } from '../util'
|
|
39
|
+
import NavLink from '@theme/components/NavLink.vue'
|
|
40
|
+
import { umLoggedin } from '@cob/rest-api-wrapper';
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'NavLinks',
|
|
44
|
+
|
|
45
|
+
components: {
|
|
46
|
+
NavLink,
|
|
47
|
+
DropdownLink
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
data: () => ({
|
|
51
|
+
userInfo : {},
|
|
52
|
+
loggedIn : false
|
|
53
|
+
}),
|
|
54
|
+
created() {
|
|
55
|
+
umLoggedin().then( userInfo => {this.userInfo = userInfo, this.loggedIn=userInfo.username != 'anonymous' }).catch( () => this.loggedIn == false)
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
userNav () {
|
|
59
|
+
return this.$themeLocaleConfig.nav || this.$site.themeConfig.nav || []
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
nav () {
|
|
63
|
+
const { locales } = this.$site
|
|
64
|
+
if (locales && Object.keys(locales).length > 1) {
|
|
65
|
+
const currentLink = this.$page.path
|
|
66
|
+
const routes = this.$router.options.routes
|
|
67
|
+
const themeLocales = this.$site.themeConfig.locales || {}
|
|
68
|
+
const languageDropdown = {
|
|
69
|
+
text: this.$themeLocaleConfig.selectText || 'Languages',
|
|
70
|
+
ariaLabel: this.$themeLocaleConfig.ariaLabel || 'Select language',
|
|
71
|
+
items: Object.keys(locales).map(path => {
|
|
72
|
+
const locale = locales[path]
|
|
73
|
+
const text = themeLocales[path] && themeLocales[path].label || locale.lang
|
|
74
|
+
let link
|
|
75
|
+
// Stay on the current page
|
|
76
|
+
if (locale.lang === this.$lang) {
|
|
77
|
+
link = currentLink
|
|
78
|
+
} else {
|
|
79
|
+
// Try to stay on the same page
|
|
80
|
+
link = currentLink.replace(this.$localeConfig.path, path)
|
|
81
|
+
// fallback to homepage
|
|
82
|
+
if (!routes.some(route => route.path === link)) {
|
|
83
|
+
link = path
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { text, link }
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
return [...this.userNav, languageDropdown]
|
|
90
|
+
}
|
|
91
|
+
return this.userNav
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
userLinks () {
|
|
95
|
+
let userLinks = (this.nav || []).map(link => {
|
|
96
|
+
return Object.assign(resolveNavLinkItem(link), {
|
|
97
|
+
items: (link.items || []).map(resolveNavLinkItem)
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
return userLinks.filter(item => item.ifLoggedIn == undefined ? true : item.ifLoggedIn == this.loggedIn )
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
repoLink () {
|
|
104
|
+
const { repo } = this.$site.themeConfig
|
|
105
|
+
if (repo) {
|
|
106
|
+
return /^https?:/.test(repo)
|
|
107
|
+
? repo
|
|
108
|
+
: `https://github.com/${repo}`
|
|
109
|
+
}
|
|
110
|
+
return null
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
repoLabel () {
|
|
114
|
+
if (!this.repoLink) return
|
|
115
|
+
if (this.$site.themeConfig.repoLabel) {
|
|
116
|
+
return this.$site.themeConfig.repoLabel
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const repoHost = this.repoLink.match(/^https?:\/\/[^/]+/)[0]
|
|
120
|
+
const platforms = ['GitHub', 'GitLab', 'Bitbucket']
|
|
121
|
+
for (let i = 0; i < platforms.length; i++) {
|
|
122
|
+
const platform = platforms[i]
|
|
123
|
+
if (new RegExp(platform, 'i').test(repoHost)) {
|
|
124
|
+
return platform
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return 'Source'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
<style lang="stylus">
|
|
135
|
+
.nav-links
|
|
136
|
+
display inline-block
|
|
137
|
+
a
|
|
138
|
+
line-height 1.4rem
|
|
139
|
+
color inherit
|
|
140
|
+
&:hover, &.cob-router-link-active
|
|
141
|
+
color $accentColor
|
|
142
|
+
.nav-item
|
|
143
|
+
position relative
|
|
144
|
+
display inline-block
|
|
145
|
+
margin-left 1.5rem
|
|
146
|
+
line-height 2rem
|
|
147
|
+
&:first-child
|
|
148
|
+
margin-left 0
|
|
149
|
+
.repo-link
|
|
150
|
+
margin-left 1.5rem
|
|
151
|
+
|
|
152
|
+
@media (max-width: $MQMobile)
|
|
153
|
+
.nav-links
|
|
154
|
+
.nav-item, .repo-link
|
|
155
|
+
margin-left 0
|
|
156
|
+
|
|
157
|
+
@media (min-width: $MQMobile)
|
|
158
|
+
.nav-links a
|
|
159
|
+
&:hover, &.cob-router-link-active
|
|
160
|
+
color $textColor
|
|
161
|
+
.nav-item > a:not(.external)
|
|
162
|
+
&:hover, &.cob-router-link-active
|
|
163
|
+
margin-bottom -2px
|
|
164
|
+
border-bottom 2px solid lighten($accentColor, 8%)
|
|
165
|
+
</style>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header class="navbar">
|
|
3
|
+
<SidebarButton @toggle-sidebar="$emit('toggle-sidebar')" />
|
|
4
|
+
|
|
5
|
+
<RouterLink
|
|
6
|
+
:to="$localePath"
|
|
7
|
+
class="home-link"
|
|
8
|
+
>
|
|
9
|
+
<img
|
|
10
|
+
v-if="$site.themeConfig.logo"
|
|
11
|
+
class="logo"
|
|
12
|
+
:src="$withBase($site.themeConfig.logo)"
|
|
13
|
+
:alt="$siteTitle"
|
|
14
|
+
>
|
|
15
|
+
<span
|
|
16
|
+
v-if="$siteTitle"
|
|
17
|
+
ref="siteName"
|
|
18
|
+
class="site-name"
|
|
19
|
+
:class="{ 'can-hide': $site.themeConfig.logo }"
|
|
20
|
+
>{{ $siteTitle }}</span>
|
|
21
|
+
</RouterLink>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="links"
|
|
25
|
+
:style="linksWrapMaxWidth ? {
|
|
26
|
+
'max-width': linksWrapMaxWidth + 'px'
|
|
27
|
+
} : {}"
|
|
28
|
+
>
|
|
29
|
+
<AlgoliaSearchBox
|
|
30
|
+
v-if="isAlgoliaSearch"
|
|
31
|
+
:options="algolia"
|
|
32
|
+
/>
|
|
33
|
+
<SearchBox v-else-if="$site.themeConfig.search !== false && $page.frontmatter.search !== false" />
|
|
34
|
+
<NavLinks class="can-hide" />
|
|
35
|
+
</div>
|
|
36
|
+
</header>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import AlgoliaSearchBox from '@AlgoliaSearchBox'
|
|
41
|
+
import SearchBox from '@SearchBox'
|
|
42
|
+
import SidebarButton from '@theme/components/SidebarButton.vue'
|
|
43
|
+
import NavLinks from '@theme/components/NavLinks.vue'
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'Navbar',
|
|
47
|
+
|
|
48
|
+
components: {
|
|
49
|
+
SidebarButton,
|
|
50
|
+
NavLinks,
|
|
51
|
+
SearchBox,
|
|
52
|
+
AlgoliaSearchBox
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
data () {
|
|
56
|
+
return {
|
|
57
|
+
linksWrapMaxWidth: null
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
computed: {
|
|
62
|
+
algolia () {
|
|
63
|
+
return this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
isAlgoliaSearch () {
|
|
67
|
+
return this.algolia && this.algolia.apiKey && this.algolia.indexName
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
mounted () {
|
|
72
|
+
const MOBILE_DESKTOP_BREAKPOINT = 719 // refer to config.styl
|
|
73
|
+
const NAVBAR_VERTICAL_PADDING = parseInt(css(this.$el, 'paddingLeft')) + parseInt(css(this.$el, 'paddingRight'))
|
|
74
|
+
const handleLinksWrapWidth = () => {
|
|
75
|
+
if (document.documentElement.clientWidth < MOBILE_DESKTOP_BREAKPOINT) {
|
|
76
|
+
this.linksWrapMaxWidth = null
|
|
77
|
+
} else {
|
|
78
|
+
this.linksWrapMaxWidth = this.$el.offsetWidth - NAVBAR_VERTICAL_PADDING
|
|
79
|
+
- (this.$refs.siteName && this.$refs.siteName.offsetWidth || 0)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
handleLinksWrapWidth()
|
|
83
|
+
window.addEventListener('resize', handleLinksWrapWidth, false)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function css (el, property) {
|
|
88
|
+
// NOTE: Known bug, will return 'auto' if style value is 'auto'
|
|
89
|
+
const win = el.ownerDocument.defaultView
|
|
90
|
+
// null means not to return pseudo styles
|
|
91
|
+
return win.getComputedStyle(el, null)[property]
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="stylus">
|
|
96
|
+
$navbar-vertical-padding = 0.7rem
|
|
97
|
+
$navbar-horizontal-padding = 1.5rem
|
|
98
|
+
|
|
99
|
+
.navbar
|
|
100
|
+
padding $navbar-vertical-padding $navbar-horizontal-padding
|
|
101
|
+
line-height $navbarHeight - 1.4rem
|
|
102
|
+
a, span, img
|
|
103
|
+
display inline-block
|
|
104
|
+
.logo
|
|
105
|
+
height $navbarHeight - 1.4rem
|
|
106
|
+
min-width $navbarHeight - 1.4rem
|
|
107
|
+
margin-right 0.8rem
|
|
108
|
+
vertical-align top
|
|
109
|
+
.site-name
|
|
110
|
+
font-size 1.3rem
|
|
111
|
+
font-weight 600
|
|
112
|
+
color $textColor
|
|
113
|
+
position relative
|
|
114
|
+
.links
|
|
115
|
+
padding-left 1.5rem
|
|
116
|
+
box-sizing border-box
|
|
117
|
+
background-color white
|
|
118
|
+
white-space nowrap
|
|
119
|
+
font-size 0.9rem
|
|
120
|
+
position absolute
|
|
121
|
+
right $navbar-horizontal-padding
|
|
122
|
+
top $navbar-vertical-padding
|
|
123
|
+
display flex
|
|
124
|
+
.search-box
|
|
125
|
+
flex: 0 0 auto
|
|
126
|
+
vertical-align top
|
|
127
|
+
|
|
128
|
+
@media (max-width: $MQMobile)
|
|
129
|
+
.navbar
|
|
130
|
+
padding-left 4rem
|
|
131
|
+
.can-hide
|
|
132
|
+
display none
|
|
133
|
+
.links
|
|
134
|
+
padding-left 1.5rem
|
|
135
|
+
.site-name
|
|
136
|
+
width calc(100vw - 9.4rem)
|
|
137
|
+
overflow hidden
|
|
138
|
+
white-space nowrap
|
|
139
|
+
text-overflow ellipsis
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="page">
|
|
3
|
+
<slot name="top" />
|
|
4
|
+
|
|
5
|
+
<Content class="theme-default-content" />
|
|
6
|
+
<PageEdit />
|
|
7
|
+
|
|
8
|
+
<PageNav v-bind="{ sidebarItems }" />
|
|
9
|
+
|
|
10
|
+
<slot name="bottom" />
|
|
11
|
+
</main>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import PageEdit from '@theme/components/PageEdit.vue'
|
|
16
|
+
import PageNav from '@theme/components/PageNav.vue'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: { PageEdit, PageNav },
|
|
20
|
+
props: ['sidebarItems']
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style lang="stylus">
|
|
25
|
+
@require '../styles/wrapper.styl'
|
|
26
|
+
|
|
27
|
+
.page
|
|
28
|
+
// padding-bottom 2rem
|
|
29
|
+
display block
|
|
30
|
+
|
|
31
|
+
</style>
|