commit d4c492688be10cb819b8b87c122aef475a622286
parent 327d1baf0566d128f792e4ede6cc45b1dc5ab112
Author: Amit Dutta <mail@amit.is-a.dev>
Date: Fri, 4 Sep 2026 13:47:28 +0530
Merge pull request #121 from notamitgamer/feat/raw-link-to-cdn
Point 'View as Raw' link to the CDN instead of GitHub raw
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/docs/.vitepress/theme/components/ExternalLinkWarning.vue b/docs/.vitepress/theme/components/ExternalLinkWarning.vue
@@ -9,7 +9,11 @@ const safeDomains = [
'amit.is-a.dev',
'github.com',
'raw.githubusercontent.com',
- 'raw.usercontent.amit.is-a.dev'
+ 'raw.usercontent.amit.is-a.dev',
+ // Technically already covered by the 'amit.is-a.dev' entry above (this
+ // is a subdomain of it), but listed explicitly so it stays safe even if
+ // that broader entry is ever narrowed or removed later.
+ 'raw.cdn.amit.is-a.dev'
]
const lockScroll = () => {
diff --git a/docs/.vitepress/theme/components/MarkdownMenu.vue b/docs/.vitepress/theme/components/MarkdownMenu.vue
@@ -42,9 +42,16 @@ const { frontmatter } = useData()
// actually committed to the repo — generated-but-uncommitted pages (e.g.
// auto-built folder indexes) have no `source`, so the template hides this
// menu entirely for them rather than falling back to a raw link that 404s.
+//
+// Points at the CDN's raw subdomain (not the app UI domain) because that's
+// what actually serves plain-text file content, matching what
+// raw.githubusercontent.com used to give us. The CI (main.yml's `sync-hf`
+// job) rsyncs this whole repo into the `bsc/` folder of the same Hugging
+// Face dataset the cdn app serves, preserving this exact relative path —
+// so `bsc/${source}` always matches.
const rawUrl = computed(() => {
const source = frontmatter.value.source
- return `https://raw.githubusercontent.com/notamitgamer/bsc/refs/heads/main/${source}`
+ return `https://raw.cdn.amit.is-a.dev/bsc/${source}`
})
const chatGptUrl = computed(() =>