mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
feat: use absolute URLs for assets
closes #473, closes #476 Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
@font-face {
|
||||
font-family: 'Geist';
|
||||
src:
|
||||
url('/lib/fonts/GeistVF.woff2') format('woff2 supports variations'),
|
||||
url('/lib/fonts/GeistVF.woff2') format('woff2-variations');
|
||||
url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') format('woff2 supports variations'),
|
||||
url('{{- "lib/fonts/GeistVF.woff2" | absURL -}}') format('woff2-variations');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'FW';
|
||||
src: url('/lib/fonts/fw.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
|
||||
@@ -14,8 +14,16 @@ export async function getImageJSON(): Promise<ImageJSON[]> {
|
||||
if (document.title.split(' | ')[0] === '404') {
|
||||
return [] // no images on 404 page
|
||||
}
|
||||
|
||||
const ogUrlMetaTag = document.querySelector(
|
||||
'meta[property="og:url"]'
|
||||
) as HTMLMetaElement | null
|
||||
const indexJsonUrl = ogUrlMetaTag?.content
|
||||
? new URL('index.json', ogUrlMetaTag.content).href
|
||||
: new URL('index.json', window.location.href).href
|
||||
|
||||
try {
|
||||
const response = await fetch(`${window.location.href}index.json`, {
|
||||
const response = await fetch(indexJsonUrl, {
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user