Skip to content

Commit 4b139d3

Browse files
authored
Merge pull request #589 from kuzzleio/develop
Release
2 parents f8b5554 + 6377fb1 commit 4b139d3

10 files changed

Lines changed: 132 additions & 150 deletions

File tree

src/.vuepress/components/MajorVersionSelector.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<div class="selector-selectedItem-name">
99
<span class="selector-selectedItem-name-wrapper">
1010
{{ selectedItem ? selectedItem.text : 'Kuzzle' }}
11-
<font-awesome-icon icon="fa-solid fa-caret-down" size="xs" aria-hidden="true"/>
1211
</span>
1312
</div>
1413
</div>

src/.vuepress/components/Redirect.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ export default {
1818
await nextTick();
1919
2020
if (typeof window !== 'undefined') {
21-
console.log(props.to);
22-
console.log('window.location', window.location);
23-
2421
// Remove leading/trailing slashes and ensure proper joining
2522
const joinUrl = (base, path) => {
2623
const cleanBase = base.replace(/\/$/, '');

src/.vuepress/components/SDKSelector.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<span v-if="currentItem" class="selector-selectedItem-name"
1717
>{{ currentItem.name }} v{{ currentItem.version }}.x</span
1818
>
19-
<font-awesome-icon icon="fa-solid fa-caret-down" size="xs" aria-hidden="true"/>
2019
</div>
2120
<ul
2221
:class="`selector-list selector-list-${showList ? 'opened' : 'closed'}`"
@@ -27,9 +26,9 @@
2726
@click="toggleList()"
2827
>
2928
<a
30-
:class="
31-
`selector-list-item-link ${item.subsection === 'api' ? 'api' : ''}`
32-
"
29+
:class="`selector-list-item-link ${
30+
item.subsection === 'api' ? 'api' : ''
31+
}`"
3332
:href="item.path"
3433
>
3534
<img
@@ -39,11 +38,9 @@
3938
:alt="item.name"
4039
/>
4140
<span
42-
:class="
43-
`selector-list-item-name${
44-
item.subsection === 'api' ? '-api' : ''
45-
}`
46-
"
41+
:class="`selector-list-item-name${
42+
item.subsection === 'api' ? '-api' : ''
43+
}`"
4744
>{{ item.name }} v{{ item.version }}.x</span
4845
>
4946
</a>
@@ -59,43 +56,45 @@ export default {
5956
name: 'SDKSelector',
6057
props: {
6158
items: { type: Array, required: true },
62-
kuzzleMajor: { type: Number, required: true }
59+
kuzzleMajor: { type: Number, required: true },
6360
},
6461
data() {
6562
return {
66-
showList: false
63+
showList: false,
6764
};
6865
},
6966
computed: {
7067
currentText() {
7168
return this.currentItem ? this.currentItem.name : 'Select SDK or API';
7269
},
7370
filteredItems() {
74-
return this.items.filter(item => item !== this.currentItem && item.icon !== undefined);
71+
return this.items.filter(
72+
(item) => item !== this.currentItem && item.icon !== undefined
73+
);
7574
},
7675
currentItem() {
77-
return this.items.find(i => this.page$.fullPath.startsWith(i.path));
78-
}
76+
return this.items.find((i) => this.page$.fullPath.startsWith(i.path));
77+
},
7978
},
8079
methods: {
81-
toggleList: function() {
80+
toggleList: function () {
8281
this.showList = !this.showList;
8382
},
84-
onClickOutside: function(e) {
83+
onClickOutside: function (e) {
8584
const el = this.$refs.selector,
8685
target = e.target;
8786
8887
if (el && el !== target && !el.contains(target)) {
8988
this.showList = false;
9089
}
91-
}
90+
},
9291
},
9392
setup() {
9493
return { page$: usePageData() };
9594
},
9695
mounted() {
9796
document.addEventListener('click', this.onClickOutside);
98-
}
97+
},
9998
};
10099
</script>
101100

src/.vuepress/config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,9 @@ export default defineUserConfig({
397397
id: JSON.stringify(process.env.GA_ID) || JSON.stringify(googleAnalyticsID),
398398
}),
399399
backToTopPlugin(),
400+
copyCodePlugin(),
400401
shikiPlugin({
401402
langs: ['js', 'ts', 'json', 'vue', 'md', 'sh', 'java', 'xml', 'groovy', 'kotlin', 'yaml', 'dart', 'csharp', 'dockerfile', 'http'],
402-
theme: 'catppuccin-macchiato',
403-
}),
404-
copyCodePlugin({
405-
selector: '.md-content div[class*="language-"] pre',
406403
}),
407404
markdownContainerPlugin({
408405
type: 'info',

src/.vuepress/theme/Header.vue

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@
2828

2929
<!-- Header title -->
3030
<div data-md-component="title">
31-
<span>
32-
<MajorVersionSelector :kuzzle-major="kuzzleMajor" />
33-
</span>
31+
<MajorVersionSelector :kuzzle-major="kuzzleMajor" />
3432
</div>
3533

3634
<div class="md-header-nav__top-menu-container">
3735
<div class="screen-only">
38-
<div style="display: none">{{ debugInfo }}</div>
3936
<TopMenu :kuzzle-major="kuzzleMajor" v-if="kuzzleMajor === 2" />
4037
<TopMenuV1 :kuzzle-major="kuzzleMajor" v-else />
4138
</div>
@@ -47,7 +44,9 @@
4744
</div>
4845

4946
<div class="divider"></div>
50-
<button class="btnCta"><a href="https://kuzzle.io" target="_blank">Discover Kuzzle</a></button>
47+
<button class="btnCta">
48+
<a href="https://kuzzle.io" target="_blank">Discover Kuzzle</a>
49+
</button>
5150

5251
<!-- Repository containing source -->
5352
<!-- <div class="md-flex__cell md-flex__cell--shrink">
@@ -79,15 +78,6 @@ export default {
7978
},
8079
},
8180
computed: {
82-
debugInfo() {
83-
return JSON.stringify(
84-
{
85-
kuzzleMajor: this.kuzzleMajor,
86-
},
87-
null,
88-
2
89-
);
90-
},
9181
searchboxOptions() {
9282
return {
9383
searchParameters: {

src/.vuepress/theme/Layout.vue

Lines changed: 27 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,10 @@
5555
<closed-sources-banner v-if="isClosedSourcesSection" />
5656
<article class="md-content__inner md-typeset">
5757
<Content />
58-
<hr class="solid">
59-
<div class="edit-link" style="color: #4e6e8e;">
60-
<a target="_blank" rel="noopener noreferrer" :href="getGithubLink()">Edit this page on Github</a>
61-
<span class="sr-only">(opens new window)</span>
62-
</div>
6358
</article>
6459
</div>
6560
</div>
6661
</main>
67-
68-
<Footer ref="footer" />
6962
</div>
7063
</div>
7164
</template>
@@ -77,21 +70,18 @@ import Header from './Header.vue';
7770
import DeprecatedBanner from '../components/DeprecatedBanner.vue';
7871
import Sidebar from './Sidebar.vue';
7972
import TOC from './TOC.vue';
80-
import Footer from './Footer.vue';
8173
import { getCurrentVersion, DEFAULT_VERSION } from '../helpers';
8274
import MajorVersionDeprecation from '../components/MajorVersionDeprecation.vue';
8375
import ClosedSourcesBanner from '../components/ClosedSourcesBanner.vue';
84-
import repositories from '../../../.repos/repositories.json';
8576
8677
export default {
8778
components: {
8879
Header,
8980
Sidebar,
9081
TOC,
9182
DeprecatedBanner,
92-
Footer,
9383
MajorVersionDeprecation,
94-
ClosedSourcesBanner
84+
ClosedSourcesBanner,
9585
},
9686
setup() {
9787
return {
@@ -126,7 +116,7 @@ export default {
126116
},
127117
sdkList() {
128118
return this.page$.sectionList.filter(
129-
s =>
119+
(s) =>
130120
s.kuzzleMajor === this.kuzzleMajor &&
131121
(s.section === 'sdk' || s.subsection === 'api') &&
132122
s.released
@@ -154,20 +144,6 @@ export default {
154144
},
155145
},
156146
methods: {
157-
getGithubLink () {
158-
const fullPath = this.page$.fullPath;
159-
const base = fullPath.replace(this.page$.regularPath, '');
160-
const relativePath = fullPath.replace(base, '');
161-
const repository = repositories.find(repo => repo.deploy_path.startsWith(base));
162-
163-
if (! repository) {
164-
return;
165-
}
166-
167-
const link = `${repository.url.replace('.git', '')}/blob/${repository.dev}/doc/${repository.doc_version}/${relativePath}index.md`;
168-
169-
return link;
170-
},
171147
openSidebar() {
172148
this.sidebarOpen = true;
173149
},
@@ -180,8 +156,8 @@ export default {
180156
},
181157
setContainerPadding() {
182158
try {
183-
const padding = this.$refs.header.$el.querySelector('header')
184-
.offsetHeight;
159+
const padding =
160+
this.$refs.header.$el.querySelector('header').offsetHeight;
185161
186162
if (padding === null || typeof padding === 'undefined') {
187163
return;
@@ -213,61 +189,59 @@ export default {
213189
return;
214190
}
215191
216-
const topBoundary = this.$refs.header.$el.querySelector('header')
217-
.offsetHeight;
192+
const topBoundary =
193+
this.$refs.header.$el.querySelector('header').offsetHeight;
218194
219195
if (topBoundary === null || typeof topBoundary === 'undefined') {
220196
return;
221197
}
222198
223199
const visible = window.innerHeight - topBoundary;
224-
let sidebarHeight = visible - this.$refs.footer.$el.offsetHeight;
200+
let sidebarHeight = visible - 0;
225201
226202
if (this.$refs.container.offsetHeight > visible) {
227203
sidebarHeight = Math.min(
228204
visible,
229205
this.$refs.container.offsetHeight -
230-
this.$refs.footer.$el.offsetHeight -
206+
0 -
231207
window.pageYOffset -
232208
topBoundary
233209
);
234210
}
235211
236212
this.$refs.sidebar.$el.style = `height: ${sidebarHeight}px`;
237213
this.$refs.toc.style = `height: ${sidebarHeight}px`;
238-
}
214+
},
239215
},
240216
mounted() {
241-
// fix scroll to anchor on chrome https://github.com/vuejs/vuepress/issues/2558
242-
if (location.hash && location.hash !== '#') {
243-
const anchorLocation = decodeURIComponent(location.hash);
244-
const anchorElement = document.querySelector(anchorLocation);
245-
if (anchorElement && anchorElement.offsetTop)
246-
window.scrollTo(0, anchorElement.offsetTop);
247-
}
248-
249-
window.addEventListener('resize', this.computeContentHeight.bind(this));
250-
window.addEventListener('scroll', this.computeSidebarHeight.bind(this));
217+
try {
218+
window.addEventListener('resize', this.computeContentHeight.bind(this));
219+
window.addEventListener('scroll', this.computeSidebarHeight.bind(this));
251220
252-
this.headerResizeObserver = new ResizeObserver(
253-
this.computeContentHeight.bind(this)
254-
);
255-
this.headerResizeObserver.observe(this.$refs.header.$el.querySelector('header'));
221+
this.headerResizeObserver = new ResizeObserver(
222+
this.computeContentHeight.bind(this)
223+
);
224+
this.headerResizeObserver.observe(
225+
this.$refs.header.$el.querySelector('header')
226+
);
256227
257-
this.removeRouterListener = this.router$.afterEach(() => {
258-
this.$nextTick(() => {
259-
this.computeContentHeight();
228+
this.removeRouterListener = this.router$.afterEach(() => {
229+
this.$nextTick(() => {
230+
this.computeContentHeight();
231+
});
260232
});
261-
});
262233
263-
this.computeContentHeight();
234+
this.computeContentHeight();
235+
} catch (error) {
236+
console.error('Error setting up layout:', error);
237+
}
264238
},
265239
beforeUnmount() {
266240
window.removeEventListener('resize', this.computeContentHeight.bind(this));
267241
window.removeEventListener('scroll', this.computeSidebarHeight.bind(this));
268242
269243
this.headerResizeObserver.disconnect();
270244
this.removeRouterListener?.();
271-
}
245+
},
272246
};
273247
</script>

src/.vuepress/theme/NotFound.vue

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@
1010
<main class="md-main">
1111
<div class="md-main__inner md-grid" data-md-component="container">
1212
<!-- Main navigation -->
13-
<Sidebar
14-
ref="sidebar"
15-
:kuzzleMajor="kuzzleMajor"
16-
:sdkList="[]"
17-
:sidebarOpen="sidebarOpen"
18-
@closeSidebar="closeSidebar"
19-
/>
20-
<div
21-
class="md-sidebar md-sidebar--primary"
22-
data-md-component="navigation"
23-
ref="sidebar"
24-
>
25-
<div
26-
v-if="!page$.frontmatter.nosidebar"
27-
class="md-sidebar__scrollwrap"
28-
>
29-
<div class="md-sidebar__inner"></div>
30-
</div>
31-
</div>
3213

3314
<!-- Main container -->
3415
<div class="md-content">
@@ -55,7 +36,6 @@
5536
</div>
5637
</div>
5738
</main>
58-
<Footer ref="footer" />
5939
</div>
6040
</div>
6141
</template>
@@ -66,15 +46,11 @@ import { usePageData } from 'vuepress/client';
6646
import { getCurrentVersion } from '../helpers';
6747
import Header from './Header.vue';
6848
import btnCta from '../components/Cta.vue';
69-
import Footer from './Footer.vue';
70-
import Sidebar from './Sidebar.vue';
7149
7250
export default {
7351
components: {
7452
Header,
7553
btnCta,
76-
Footer,
77-
Sidebar
7854
},
7955
data() {
8056
return {

0 commit comments

Comments
 (0)