Skip to content

Commit 689dd5f

Browse files
committed
fix(docs): resolve Git Pages compatibility issues after Jekyll migration
- Add `layout: home` to en/zh index pages so VitePress renders them with the homepage layout instead of the doc layout (sidebar + TOC) - Define 6 missing CSS classes (.home-shell, .home-hero-grid, etc.) used by homepage HTML but never declared in style.css - Fix button contrast: brand buttons now use solid #76B900 + white text instead of dark gradient + black text; alt/outline buttons use #5A8F00 for WCAG AA compliance - Replace window.location.href with VitePress router.go() for SPA navigation and remove hardcoded /sgemm-optimization/ base path - Use actions/configure-pages@v5 to dynamically resolve base path in GitHub Actions instead of hardcoding it - Delete stale Jekyll files at repo root (index.md, zh/docs/, zh/)
1 parent 0c6ec9c commit 689dd5f

20 files changed

Lines changed: 124 additions & 1834 deletions

.github/workflows/pages.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,27 @@ jobs:
4141
working-directory: docs
4242
run: npm ci
4343

44+
- name: Configure GitHub Pages
45+
id: pages
46+
uses: actions/configure-pages@v5
47+
48+
- name: Set VitePress base
49+
shell: bash
50+
env:
51+
BASE_PATH: ${{ steps.pages.outputs.base_path }}
52+
run: |
53+
set -euo pipefail
54+
if [[ -z "${BASE_PATH}" ]]; then
55+
base="/"
56+
else
57+
base="${BASE_PATH%/}/"
58+
fi
59+
echo "VITEPRESS_BASE=${base}" >> "$GITHUB_ENV"
60+
4461
- name: Build with VitePress
4562
working-directory: docs
4663
env:
47-
VITEPRESS_BASE: /sgemm-optimization/
64+
VITEPRESS_BASE: ${{ env.VITEPRESS_BASE }}
4865
run: npm run build
4966

5067
- name: Add .nojekyll

docs/.vitepress/theme/style.css

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,20 @@
142142
}
143143

144144
.VPHero .VPButton.medium.brand {
145-
background: linear-gradient(135deg, #76B900, #5A8F00);
145+
background: #76B900;
146146
border: none;
147-
color: #000;
147+
color: #fff;
148148
}
149149

150150
.VPHero .VPButton.medium.brand:hover {
151-
background: linear-gradient(135deg, #8FD917, #76B900);
151+
background: #8FD917;
152152
box-shadow: 0 4px 12px rgba(118, 185, 0, 0.3);
153153
}
154154

155155
.VPHero .VPButton.medium.alt {
156-
border: 2px solid #76B900;
156+
border: 2px solid #5A8F00;
157157
background: transparent;
158-
color: #76B900;
158+
color: #5A8F00;
159159
}
160160

161161
.VPHero .VPButton.medium.alt:hover {
@@ -448,6 +448,57 @@ div[class*='language-'] {
448448

449449
/* === Homepage Custom Components === */
450450

451+
/* Homepage Layout Shell */
452+
.home-shell {
453+
max-width: 1152px;
454+
margin: 0 auto;
455+
padding: calc(var(--vp-nav-height) + 48px) var(--spacing-lg) 48px;
456+
}
457+
458+
.home-hero-grid {
459+
display: grid;
460+
grid-template-columns: 1fr 320px;
461+
gap: var(--spacing-2xl);
462+
align-items: start;
463+
}
464+
465+
.home-eyebrow {
466+
font-size: 0.78rem;
467+
font-weight: 600;
468+
text-transform: uppercase;
469+
letter-spacing: 0.1em;
470+
color: #76B900;
471+
margin-bottom: var(--spacing-md);
472+
}
473+
474+
.home-main-title {
475+
font-size: 2.8rem;
476+
font-weight: 800;
477+
line-height: 1.1;
478+
letter-spacing: -1px;
479+
color: var(--vp-c-text-1);
480+
margin: 0 0 var(--spacing-lg);
481+
background: linear-gradient(135deg, #76B900, #00D4AA);
482+
-webkit-background-clip: text;
483+
-webkit-text-fill-color: transparent;
484+
background-clip: text;
485+
}
486+
487+
.home-main-subtitle {
488+
font-size: 1.05rem;
489+
line-height: 1.7;
490+
color: var(--vp-c-text-2);
491+
margin-bottom: var(--spacing-xl);
492+
max-width: 560px;
493+
}
494+
495+
.home-action-row {
496+
display: flex;
497+
flex-wrap: wrap;
498+
gap: var(--spacing-sm);
499+
margin-bottom: var(--spacing-lg);
500+
}
501+
451502
/* Performance Cards Grid */
452503
.perf-grid {
453504
display: grid;
@@ -586,8 +637,8 @@ div[class*='language-'] {
586637
.btn {
587638
display: inline-block;
588639
padding: 0.75rem 1.5rem;
589-
background: linear-gradient(135deg, #76B900, #5A8F00);
590-
color: #000;
640+
background: #76B900;
641+
color: #fff;
591642
font-weight: 600;
592643
border-radius: var(--radius-md);
593644
text-decoration: none;
@@ -599,18 +650,18 @@ div[class*='language-'] {
599650
.btn:hover {
600651
transform: translateY(-1px);
601652
box-shadow: 0 4px 12px rgba(118, 185, 0, 0.3);
602-
color: #000;
653+
color: #fff;
603654
}
604655

605656
.btn-outline {
606657
background: transparent;
607658
border: 2px solid #76B900;
608-
color: #76B900;
659+
color: #5A8F00;
609660
}
610661

611662
.btn-outline:hover {
612663
background: #76B900;
613-
color: #000;
664+
color: #fff;
614665
}
615666

616667
/* === Responsive Design === */
@@ -642,6 +693,18 @@ div[class*='language-'] {
642693
.knowledge-grid {
643694
grid-template-columns: 1fr;
644695
}
696+
697+
.home-hero-grid {
698+
grid-template-columns: 1fr;
699+
}
700+
701+
.home-main-title {
702+
font-size: 2rem;
703+
}
704+
705+
.home-main-subtitle {
706+
font-size: 0.95rem;
707+
}
645708
}
646709

647710
@media (max-width: 640px) {
@@ -657,4 +720,16 @@ div[class*='language-'] {
657720
.VPFeatures .VPFeature {
658721
padding: var(--spacing-lg);
659722
}
723+
724+
.home-shell {
725+
padding: calc(var(--vp-nav-height) + 24px) var(--spacing-md) 24px;
726+
}
727+
728+
.home-main-title {
729+
font-size: 1.6rem;
730+
}
731+
732+
.signal-grid {
733+
grid-template-columns: 1fr;
734+
}
660735
}

docs/en/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
layout: home
23
title: SGEMM Optimization
34
---
45

docs/index.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
---
22
layout: home
3+
hero:
4+
name: SGEMM Optimization
5+
text: ' '
6+
actions:
7+
- theme: brand
8+
text: English
9+
link: /en/
10+
- theme: alt
11+
text: 简体中文
12+
link: /zh/
313
---
414

515
<script setup>
616
import { onMounted } from 'vue'
17+
import { useRouter } from 'vitepress'
718

819
onMounted(() => {
9-
// Auto-detect language and redirect
20+
const router = useRouter()
1021
const savedLang = localStorage.getItem('vitepress-locale')
1122
const browserLang = navigator.language.toLowerCase()
12-
13-
if (savedLang) {
14-
window.location.href = savedLang === 'zh' ? '/sgemm-optimization/zh/' : '/sgemm-optimization/en/'
23+
24+
if (savedLang === 'zh') {
25+
router.go('/zh/')
26+
} else if (savedLang === 'en') {
27+
router.go('/en/')
1528
} else if (browserLang.startsWith('zh')) {
16-
window.location.href = '/sgemm-optimization/zh/'
29+
router.go('/zh/')
1730
} else {
18-
window.location.href = '/sgemm-optimization/en/'
31+
router.go('/en/')
1932
}
2033
})
2134
</script>
22-
23-
# SGEMM Optimization
24-
25-
Redirecting to your preferred language...

docs/zh/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
layout: home
23
title: SGEMM 优化
34
---
45

index.md

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

0 commit comments

Comments
 (0)