mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
Fixed image theme check
This commit is contained in:
parent
5a72e0a54a
commit
6867034ec9
@ -24,8 +24,9 @@ export function renderThemedLinks(theme: "dark" | "light") {
|
|||||||
const imageGroups = { theme: 1, extension: 2 }
|
const imageGroups = { theme: 1, extension: 2 }
|
||||||
Object.values(document.getElementsByTagName("img")).forEach((img) => {
|
Object.values(document.getElementsByTagName("img")).forEach((img) => {
|
||||||
if (img.src.match(imageExtensions)) {
|
if (img.src.match(imageExtensions)) {
|
||||||
const newImg = imageExtensions.exec(img.src)
|
const imageSource = img.src
|
||||||
img.src.replace(imageExtensions, `.${theme}.${newImg![imageGroups.extension]}`)
|
const newImg = imageExtensions.exec(imageSource)
|
||||||
|
img.src = imageSource.replace(imageExtensions, `.${theme}.${newImg![imageGroups.extension]}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user