build(website): fix build script for Netlify (#2901)

This commit is contained in:
ylemkimon
2021-04-07 02:51:58 +09:00
committed by GitHub
parent 86518c27eb
commit b45b3aa5ec

View File

@@ -44,7 +44,7 @@ if (process.env.NETLIFY_API_KEY) {
// use KaTeX from CDN on the main page for Netlify production deploy
if (process.env.CONTEXT === 'production') {
const version = require('../versions.json')[0];
const {version} = require('../../package.json');
let indexHtml = fs.readFileSync('pages/index.html', 'utf8');
indexHtml = indexHtml.replace(/(["'])static\/(katex|fonts)/g,
`$1https://cdn.jsdelivr.net/npm/katex@${version}/dist/$2`);