Skip to content

Commit fbf4247

Browse files
committed
merge: incorporate master base-path fixes
2 parents 7a8ba09 + 1a045b1 commit fbf4247

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

docs/.vitepress/tests/theme-primitives.test.mjs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ function read(relativePath) {
1616
return fs.readFileSync(path.join(themeDir, relativePath), 'utf8')
1717
}
1818

19+
function readAllCss() {
20+
const mainCss = read('style.css')
21+
const tokensDir = path.join(themeDir, 'tokens')
22+
let allCss = mainCss
23+
24+
if (fs.existsSync(tokensDir)) {
25+
const tokenFiles = fs.readdirSync(tokensDir).filter(file => file.endsWith('.css'))
26+
for (const file of tokenFiles) {
27+
allCss += `\n${fs.readFileSync(path.join(tokensDir, file), 'utf8')}`
28+
}
29+
}
30+
31+
return allCss
32+
}
33+
1934
function extractLandingArray(content, propName) {
2035
const match = content.match(new RegExp(`:${propName}='\\[(.*?)\\]'`, 's'))
2136

@@ -92,8 +107,7 @@ async function loadSfcComponent(relativePath) {
92107
}
93108

94109
test('style.css keeps tokenized selectors for the live homepage, Mermaid, and SVG surfaces', () => {
95-
const css = read('style.css')
96-
const colorTokens = read('tokens/colors.css')
110+
const css = readAllCss()
97111

98112
for (const token of [
99113
'--wp-paper-1',
@@ -109,7 +123,7 @@ test('style.css keeps tokenized selectors for the live homepage, Mermaid, and SV
109123
'--wp-diagram-stroke',
110124
'--wp-icon-muted',
111125
]) {
112-
assert.match(colorTokens, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
126+
assert.match(css, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
113127
}
114128

115129
for (const selector of [
@@ -187,6 +201,7 @@ test('bilingual landing pages preserve copy while using shared whitepaper primit
187201

188202
assert.match(enIndex, /<BaseAwareLink href="\/en\/getting-started\/quickstart">Quick Start guide<\/BaseAwareLink>/)
189203
assert.match(zhIndex, /<BaseAwareLink href="\/zh\/getting-started\/quickstart"><\/BaseAwareLink>/)
204+
assert.match(read('SectionIndex.vue'), /BaseAwareLink/)
190205
assert.match(enIndex, /:actions='/)
191206
assert.match(zhIndex, /:actions='/)
192207
assert.doesNotMatch(enIndex, /href: "\.\//)

docs/.vitepress/tests/whitepaper-content.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test('landing page states the stronger thesis and validation ladder', () => {
6262
const content = read('en/index.md')
6363

6464
assert.match(content, /performance advice as something to compile, test, benchmark, and falsify/i)
65-
assert.match(content, /debugubsan/)
65+
assert.match(content, /debugubsan/i)
6666
assert.match(content, /## Who should read this guide\?/)
6767
assert.match(content, /## Recommended study path/)
6868
assert.match(content, /## First-run route/)

docs/.vitepress/theme/LandingHero.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ const props = withDefaults(defineProps<{
3838
})
3939
4040
const isVisible = ref(false)
41-
4241
const actionItems = props.actions ?? props.links ?? []
4342
4443
onMounted(() => {
45-
// Trigger entrance animation after mount
44+
// Trigger entrance animation after mount.
4645
requestAnimationFrame(() => {
4746
setTimeout(() => {
4847
isVisible.value = true
@@ -86,8 +85,18 @@ onMounted(() => {
8685
:class="{ 'landing-hero__cta--primary': action.primary }"
8786
>
8887
{{ action.label }}
89-
<svg v-if="action.primary" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
90-
<path d="M5 12h14M12 5l7 7-7 7"/>
88+
<svg
89+
v-if="action.primary"
90+
width="16"
91+
height="16"
92+
viewBox="0 0 24 24"
93+
fill="none"
94+
stroke="currentColor"
95+
stroke-width="2"
96+
stroke-linecap="round"
97+
stroke-linejoin="round"
98+
>
99+
<path d="M5 12h14M12 5l7 7-7 7" />
91100
</svg>
92101
</BaseAwareLink>
93102
</nav>

0 commit comments

Comments
 (0)