mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-28 19:35:27 +08:00
fix: preserve docs base path for sidebar logo (#120)
Co-authored-by: dadachann <[email protected]>
This commit is contained in:
@@ -26,6 +26,8 @@ function prefixPublicAssets(content) {
|
||||
.replaceAll("'/images/", `'${BASE_PATH}/images/`)
|
||||
.replaceAll('"/favicon.ico"', `"${BASE_PATH}/favicon.ico"`)
|
||||
.replaceAll("'/favicon.ico'", `'${BASE_PATH}/favicon.ico'`)
|
||||
.replaceAll('"/langbot-logo.png"', `"${BASE_PATH}/langbot-logo.png"`)
|
||||
.replaceAll("'/langbot-logo.png'", `'${BASE_PATH}/langbot-logo.png'`)
|
||||
.replaceAll('"/rss.xml"', `"${BASE_PATH}/rss.xml"`)
|
||||
.replaceAll("'/rss.xml'", `'${BASE_PATH}/rss.xml'`);
|
||||
}
|
||||
|
||||
@@ -253,6 +253,8 @@ test("rendered navbar and documentation tree use each locale's docs.json labels"
|
||||
for (const locale of locales) {
|
||||
const html = await readFile(path.join(publicRoot, locale, "insight/guide/index.html"), "utf8");
|
||||
for (const value of expected[locale]) assert.ok(html.includes(value), `${locale} navbar missing ${value}`);
|
||||
assert.match(html, /<img[^>]+src="\/docs\/langbot-logo\.png"[^>]*>/, `${locale} docs brand logo is not base-path scoped`);
|
||||
assert.doesNotMatch(html, /<img[^>]+src="\/langbot-logo\.png"[^>]*>/, `${locale} docs brand logo points outside /docs`);
|
||||
assert.ok(!html.includes(`href="${removedHomeLinks[locale]}"`), `${locale} navbar still includes Home`);
|
||||
for (const languageName of ["English", "简体中文", "日本語"]) {
|
||||
assert.ok(html.includes(languageName), `${locale} language selector missing ${languageName}`);
|
||||
|
||||
Reference in New Issue
Block a user