fix: fix all hardcoded /zh-cn/ links in home page components (HomeI18n, HomeAppleFooter, HomeFeatures)
This commit is contained in:
@@ -47,17 +47,13 @@ const isCjkLocale = computed(() => {
|
||||
|
||||
const topPromo = computed(() => {
|
||||
const code = lang.value ? lang.value.toLowerCase() : 'en'
|
||||
if (code === 'zh-cn' || code === 'zh-tw') {
|
||||
return {
|
||||
text: '用 Easy-Vibe 构建你的第一个 AI 应用,最快当天可上线原型。',
|
||||
cta: '开始学习 ›',
|
||||
link: '/zh-cn/stage-1/learning-map/'
|
||||
}
|
||||
}
|
||||
const isChinese = code === 'zh-cn' || code === 'zh-tw'
|
||||
return {
|
||||
text: 'Build your first AI app with Easy-Vibe and ship a working prototype fast.',
|
||||
cta: 'Start learning ›',
|
||||
link: '/en/stage-1/learning-map/'
|
||||
text: isChinese
|
||||
? '用 Easy-Vibe 构建你的第一个 AI 应用,最快当天可上线原型。'
|
||||
: 'Build your first AI app with Easy-Vibe and ship a working prototype fast.',
|
||||
cta: isChinese ? '开始学习 ›' : 'Start learning ›',
|
||||
link: `/${code}/stage-1/learning-map/`
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -88,6 +88,11 @@ const appleFooterInfo = computed(() => {
|
||||
return content[locale] || content.en
|
||||
})
|
||||
|
||||
const footerBtnLink = computed(() => {
|
||||
const locale = t.value._locale || 'zh-cn'
|
||||
return withBase(`/${locale}/stage-1/learning-map/`)
|
||||
})
|
||||
|
||||
const footerRepositoryLink = 'https://github.com/datawhalechina/easy-vibe'
|
||||
|
||||
const footerPolicyLinkMap = {
|
||||
@@ -100,26 +105,34 @@ const footerPolicyLinkMap = {
|
||||
}
|
||||
|
||||
const footerColumnLinkMap = {
|
||||
'零基础入门': '/zh-cn/stage-1/',
|
||||
'初中级开发': '/zh-cn/stage-2/',
|
||||
'高级开发': '/zh-cn/stage-3/',
|
||||
'附录': '/zh-cn/appendix/',
|
||||
'学习地图': '/zh-cn/stage-1/learning-map/',
|
||||
'课程总览': '/zh-cn/stage-1/',
|
||||
'零基础入门': '/stage-1/',
|
||||
'初中级开发': '/stage-2/',
|
||||
'高级开发': '/stage-3/',
|
||||
'附录': '/appendix/',
|
||||
'学习地图': '/stage-1/learning-map/',
|
||||
'课程总览': '/stage-1/',
|
||||
'Foundations': '/stage-1/',
|
||||
'Junior/Mid Dev': '/stage-2/',
|
||||
'Senior Dev': '/stage-3/',
|
||||
'Appendix': '/appendix/',
|
||||
'Learning Map': '/stage-1/learning-map/',
|
||||
'Course Outline': '/stage-1/',
|
||||
'Overview': '/guide/introduction',
|
||||
}
|
||||
|
||||
const footerExternalLinks = {
|
||||
'GitHub 仓库': 'https://github.com/datawhalechina/easy-vibe',
|
||||
'Foundations': '/en/stage-1/',
|
||||
'Junior/Mid Dev': '/en/stage-2/',
|
||||
'Senior Dev': '/en/stage-3/',
|
||||
'Appendix': '/en/appendix/',
|
||||
'Learning Map': '/en/stage-1/learning-map/',
|
||||
'Course Outline': '/en/stage-1/',
|
||||
'GitHub Repository': 'https://github.com/datawhalechina/easy-vibe',
|
||||
'Overview': '/en/guide/introduction',
|
||||
'Changelog': 'https://github.com/datawhalechina/easy-vibe/releases'
|
||||
'Changelog': 'https://github.com/datawhalechina/easy-vibe/releases',
|
||||
}
|
||||
|
||||
const getFooterLink = (label) => {
|
||||
return footerColumnLinkMap[label] || '#'
|
||||
const external = footerExternalLinks[label]
|
||||
if (external) return external
|
||||
const basePath = footerColumnLinkMap[label]
|
||||
if (!basePath) return '#'
|
||||
const locale = t.value._locale || 'zh-cn'
|
||||
return `/${locale}${basePath}`
|
||||
}
|
||||
|
||||
const getPolicyLink = (label) => {
|
||||
@@ -140,7 +153,7 @@ const resolveFooterHref = (link) => {
|
||||
<p>{{ t.footer.desc }}</p>
|
||||
<a
|
||||
class="buy-btn large"
|
||||
:href="withBase('/zh-cn/stage-1/learning-map/')"
|
||||
:href="footerBtnLink"
|
||||
>{{ t.footer.btn }}</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -201,4 +201,4 @@ export const appendixCards = [
|
||||
tag: 'General',
|
||||
link: '/zh-cn/appendix/1-computer-fundamentals/computer-networks'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,8 +41,7 @@
|
||||
color: #6e6e73;
|
||||
max-width: 760px;
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC',
|
||||
sans-serif;
|
||||
-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', sans-serif;
|
||||
}
|
||||
|
||||
.dark .section-category,
|
||||
@@ -65,13 +64,12 @@ a {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
:is(
|
||||
.feature-card,
|
||||
.comm-card,
|
||||
.prod-card,
|
||||
.appendix-card,
|
||||
.buy-btn
|
||||
):is(:hover, :focus, :focus-visible, :active) {
|
||||
:is(.feature-card, .comm-card, .prod-card, .appendix-card, .buy-btn):is(
|
||||
:hover,
|
||||
:focus,
|
||||
:focus-visible,
|
||||
:active
|
||||
) {
|
||||
border-bottom-color: transparent !important;
|
||||
text-decoration: none !important;
|
||||
outline: none !important;
|
||||
|
||||
@@ -27,7 +27,6 @@ export const createReadingBookmark = ({
|
||||
updatedAt: now()
|
||||
})
|
||||
|
||||
|
||||
export const createReadingBookmarkSnapshot = ({
|
||||
path,
|
||||
getTitle = () => '',
|
||||
|
||||
@@ -74,13 +74,11 @@ describe('reading bookmarks', () => {
|
||||
}
|
||||
)
|
||||
assert.equal(
|
||||
readReadingBookmark(storage, '/easy-vibe/en/stage-1/intro/', 1000)
|
||||
.title,
|
||||
readReadingBookmark(storage, '/easy-vibe/en/stage-1/intro/', 1000).title,
|
||||
'English title'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
it('keeps delayed saves bound to the path captured before navigation', () => {
|
||||
const storage = createStorage()
|
||||
let currentPath = '/easy-vibe/zh-cn/page-a/'
|
||||
@@ -100,22 +98,16 @@ describe('reading bookmarks', () => {
|
||||
})
|
||||
)
|
||||
|
||||
assert.equal(
|
||||
readReadingBookmark(storage, currentPath, 1000),
|
||||
null
|
||||
)
|
||||
assert.deepEqual(
|
||||
readReadingBookmark(storage, scheduledPath, 1000),
|
||||
{
|
||||
version: 1,
|
||||
path: scheduledPath,
|
||||
title: '页面 A',
|
||||
section: '小节 A',
|
||||
scrollY: 240,
|
||||
progress: 32,
|
||||
updatedAt: 777
|
||||
}
|
||||
)
|
||||
assert.equal(readReadingBookmark(storage, currentPath, 1000), null)
|
||||
assert.deepEqual(readReadingBookmark(storage, scheduledPath, 1000), {
|
||||
version: 1,
|
||||
path: scheduledPath,
|
||||
title: '页面 A',
|
||||
section: '小节 A',
|
||||
scrollY: 240,
|
||||
progress: 32,
|
||||
updatedAt: 777
|
||||
})
|
||||
})
|
||||
|
||||
it('normalizes invalid numeric values', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
<url>
|
||||
<loc>https://datawhalechina.github.io/easy-vibe/zh-cn/</loc>
|
||||
<lastmod>2026-05-14T12:39:03+08:00</lastmod>
|
||||
<lastmod>2026-05-20T23:20:16+08:00</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
<xhtml:link rel="alternate" hreflang="zh-CN" href="https://datawhalechina.github.io/easy-vibe/zh-cn/"/>
|
||||
|
||||
Reference in New Issue
Block a user