diff --git a/packages/slidev/node/setups/indexHtml.ts b/packages/slidev/node/setups/indexHtml.ts
index a9c03a9c41..4c0668bcd7 100644
--- a/packages/slidev/node/setups/indexHtml.ts
+++ b/packages/slidev/node/setups/indexHtml.ts
@@ -49,11 +49,13 @@ export default function setupIndexHtml({ mode, entry, clientRoot, userRoot, root
if (data.features.tweet)
body += '\n'
- if (data.config.fonts.webfonts.length && data.config.fonts.provider === 'google')
- head += `\n`
-
- if (data.config.fonts.webfonts.length && data.config.fonts.provider === 'coollabs')
- head += `\n`
+ if (data.config.fonts.webfonts.length) {
+ const { provider } = data.config.fonts
+ if (provider === 'google')
+ head += `\n`
+ else if (provider === 'coollabs')
+ head += `\n`
+ }
if (data.headmatter.lang)
main = main.replace('', ``)