Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Dec 19, 2024
1 parent 1bda8ab commit 730cb00
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/slidev/node/setups/indexHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ export default function setupIndexHtml({ mode, entry, clientRoot, userRoot, root
if (data.features.tweet)
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>'

if (data.config.fonts.webfonts.length && data.config.fonts.provider === 'google')
head += `\n<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`

if (data.config.fonts.webfonts.length && data.config.fonts.provider === 'coollabs')
head += `\n<link rel="stylesheet" href="${generateCoollabsFontsUrl(data.config.fonts)}" type="text/css">`
if (data.config.fonts.webfonts.length) {
const { provider } = data.config.fonts
if (provider === 'google')
head += `\n<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`
else if (provider === 'coollabs')
head += `\n<link rel="stylesheet" href="${generateCoollabsFontsUrl(data.config.fonts)}" type="text/css">`
}

if (data.headmatter.lang)
main = main.replace('<html lang="en">', `<html lang="${data.headmatter.lang}">`)
Expand Down

0 comments on commit 730cb00

Please sign in to comment.