Skip to content

Commit d61e53a

Browse files
committed
fix: resolve GitHub Pages routing and cleanup dead code
- AlgorithmGrid: use locale-aware links with withBase() for i18n support - CustomFooter: fix logo path missing base prefix, use computed for locale - Remove unused chart.js, vue-chartjs, @vueuse/core dependencies - Delete 5 stub Vue components never used - Remove empty SCSS preprocessor config - Simplify root index.md to language gateway
1 parent 666822d commit d61e53a

12 files changed

Lines changed: 28 additions & 238 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,14 @@ export default defineConfig({
232232
root: {
233233
label: 'English',
234234
lang: 'en-US',
235-
link: '/en/',
236235
themeConfig: {
237236
nav: sharedNav('en'),
238237
sidebar: sharedSidebar['/en/'],
239238
editLink: {
240239
pattern: 'https://github.com/LessUp/compress-kit/edit/master/docs/:path',
241240
text: 'Edit this page on GitHub',
242241
},
243-
footer: {
244-
message: 'Released under the MIT License',
245-
copyright: 'Copyright © 2025-2026 LessUp. Built with VitePress.',
246-
},
242+
footer: false,
247243
outline: {
248244
level: [2, 3],
249245
label: 'On this page',
@@ -291,10 +287,7 @@ export default defineConfig({
291287
pattern: 'https://github.com/LessUp/compress-kit/edit/master/docs/:path',
292288
text: '在 GitHub 上编辑此页',
293289
},
294-
footer: {
295-
message: '基于 MIT 许可证发布',
296-
copyright: '版权所有 © 2025-2026 LessUp. 使用 VitePress 构建。',
297-
},
290+
footer: false,
298291
outline: {
299292
level: [2, 3],
300293
label: '本页内容',
@@ -361,12 +354,5 @@ export default defineConfig({
361354
'@theme': '/.vitepress/theme',
362355
},
363356
},
364-
css: {
365-
preprocessorOptions: {
366-
scss: {
367-
additionalData: '',
368-
},
369-
},
370-
},
371357
},
372358
})

docs/.vitepress/theme/components/AlgorithmGrid.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<script setup lang="ts">
2+
import { useData, withBase } from 'vitepress'
3+
import { computed } from 'vue'
4+
5+
const { localeIndex } = useData()
6+
const lang = computed(() => localeIndex.value === 'root' ? 'en' : localeIndex.value)
7+
const algoLink = (slug: string) => withBase(`/${lang.value}/algorithms/${slug}`)
8+
29
interface Algorithm {
310
id: string
411
name: string
@@ -86,7 +93,7 @@ const getSpeedBadgeClass = (level: string) => {
8693
<a
8794
v-for="(algo, index) in algorithms"
8895
:key="algo.id"
89-
:href="`/en/algorithms/${algo.slug}`"
96+
:href="algoLink(algo.slug)"
9097
class="ck-algorithm-card ck-hover-lift"
9198
:style="{ animationDelay: `${index * 100}ms` }"
9299
>

docs/.vitepress/theme/components/AlgorithmShowcase.vue

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/.vitepress/theme/components/AnimatedHero.vue

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/.vitepress/theme/components/CodePlayground.vue

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/.vitepress/theme/components/CustomFooter.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
<script setup lang="ts">
2+
import { useData, withBase } from 'vitepress'
3+
import { computed } from 'vue'
4+
const { localeIndex } = useData()
5+
const lang = computed(() => localeIndex.value === 'root' ? 'en' : localeIndex.value)
26
const currentYear = new Date().getFullYear()
7+
const link = (path: string) => withBase(`/${lang.value}${path}`)
38
</script>
49

510
<template>
611
<footer class="ck-footer">
712
<div class="footer-container">
813
<div class="footer-brand">
9-
<img src="/logo.svg" alt="CompressKit" class="footer-logo" />
14+
<img :src="withBase('/logo.svg')" alt="CompressKit" class="footer-logo" />
1015
<p class="footer-tagline">
1116
Production-ready compression algorithms in C++17, Go, and Rust
1217
</p>
@@ -23,10 +28,10 @@ const currentYear = new Date().getFullYear()
2328
<div class="footer-column">
2429
<h4>Documentation</h4>
2530
<ul>
26-
<li><a href="/en/guide/getting-started">Getting Started</a></li>
27-
<li><a href="/en/guide/algorithms">Algorithms</a></li>
28-
<li><a href="/en/benchmarks/results">Benchmarks</a></li>
29-
<li><a href="/en/api/go">API Reference</a></li>
31+
<li><a :href="link('/guide/getting-started')">Getting Started</a></li>
32+
<li><a :href="link('/guide/algorithms')">Algorithms</a></li>
33+
<li><a :href="link('/benchmarks/results')">Benchmarks</a></li>
34+
<li><a :href="link('/api/go')">API Reference</a></li>
3035
</ul>
3136
</div>
3237

@@ -43,7 +48,7 @@ const currentYear = new Date().getFullYear()
4348
<div class="footer-column">
4449
<h4>Community</h4>
4550
<ul>
46-
<li><a href="/en/guide/contributing">Contributing</a></li>
51+
<li><a :href="link('/guide/contributing')">Contributing</a></li>
4752
<li><a href="https://github.com/LessUp/compress-kit/blob/master/CODE_OF_CONDUCT.md" target="_blank" rel="noopener">Code of Conduct</a></li>
4853
<li><a href="https://github.com/LessUp/compress-kit/blob/master/SECURITY.md" target="_blank" rel="noopener">Security</a></li>
4954
</ul>

docs/.vitepress/theme/components/FeatureCard.vue

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/.vitepress/theme/components/LanguageSwitcher.vue

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/.vitepress/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import type { Theme } from 'vitepress'
22
import DefaultTheme from 'vitepress/theme'
33
import { h } from 'vue'
44
import './styles/vars.css'
5-
import './styles/custom.css'
65
import './styles/animations.css'
76
import './styles/components.css'
7+
import './styles/custom.css'
88

99
// Import custom components
1010
import StatsBar from './components/StatsBar.vue'
Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Custom styles */
1+
/* Custom styles — only rules not covered by components.css or vars.css */
22

33
/* Algorithm comparison table - highlight compression ratios */
44
.vp-doc table td:last-child {
@@ -14,47 +14,3 @@
1414
.dark .vp-doc div[class*='language-'] {
1515
border: 1px solid var(--vp-c-border);
1616
}
17-
18-
/* Hero image sizing */
19-
.VPHero .image-container {
20-
width: 200px;
21-
height: 200px;
22-
}
23-
24-
.VPHero .image-bg {
25-
width: 200px;
26-
height: 200px;
27-
}
28-
29-
/* Feature card hover effect */
30-
.VPFeature {
31-
transition: transform 0.2s ease, box-shadow 0.2s ease;
32-
}
33-
34-
.VPFeature:hover {
35-
transform: translateY(-2px);
36-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
37-
}
38-
39-
.dark .VPFeature:hover {
40-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
41-
}
42-
43-
/* Scrollbar styling */
44-
::-webkit-scrollbar {
45-
width: 8px;
46-
height: 8px;
47-
}
48-
49-
::-webkit-scrollbar-track {
50-
background: transparent;
51-
}
52-
53-
::-webkit-scrollbar-thumb {
54-
background: var(--vp-c-divider);
55-
border-radius: 4px;
56-
}
57-
58-
::-webkit-scrollbar-thumb:hover {
59-
background: var(--vp-c-text-3);
60-
}

0 commit comments

Comments
 (0)