Skip to content

Commit 24d8563

Browse files
committed
fix: adjust audio file paths for non-production environments
1 parent 295d971 commit 24d8563

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

1000-hours/.vitepress/theme/components/SpeakWordInlineConverter.vue

+10
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ function convertToInlineComponent(el) {
9090
const dataAudio = fillDataAudio(el);
9191
console.log('inline component', dataAudio)
9292
93+
// check the hostname.
94+
// if the hostname is not `1000h.org`, add `/1000-hours` to the dataAudio[i].value
95+
if (window.location.hostname !== '1000h.org' || window.location.hostname !== 'localhost') {
96+
for (let i = 0; i < dataAudio.length; i++) {
97+
if (dataAudio[i].value) {
98+
dataAudio[i].value = `/1000-hours${dataAudio[i].value}`;
99+
}
100+
}
101+
}
102+
93103
const wrapperEl = document.createElement('div')
94104
wrapperEl.classList.add('speak-word-wrapper')
95105
const canEl = document.createElement('div')

0 commit comments

Comments
 (0)