Skip to content

Commit

Permalink
fix(hexo): URL of font for stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Apr 7, 2023
1 parent 9f1689b commit f6b39bd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ function copyAssets(distRoot, polyfill) {

const distStyleDirPath = `${distRoot}/stylesheets/ksio/`;
const shareSnsStyleFilePath = `${distStyleDirPath}/vendors/share.scss`;

saveData(shareSnsStyleFilePath, readData(shareSnsStyleFilePath).replace(new RegExp('fonts/vendors/share', 'g'), 'ksio/vendors/share'));
const shareSnsStyleFileContent = readData(shareSnsStyleFilePath);

if (!polyfill) {
return;
return saveData(shareSnsStyleFilePath, shareSnsStyleFileContent.replace(new RegExp('fonts/vendors/share', 'g'), 'ksio/vendors/share'));
}

saveData(shareSnsStyleFilePath, shareSnsStyleFileContent.replace(new RegExp('fonts/vendors/share', 'g'), '../../../fonts/ksio/vendors/share').replace(new RegExp('font-url', 'g'), 'url'));

const faStyleFilePath = `${distStyleDirPath}/polyfills/_font-awesome-sprockets.scss`;

saveData(faStyleFilePath, readData(faStyleFilePath).replace(' font-path($path)', ' "../fonts/ksio/polyfills/#{$path}"'));

['_all', '_bootstrap-custom', '_helper', '_painter'].forEach(fileName => {
const filePath = `${distStyleDirPath}/${fileName}.scss`;
const bsStr = fileName === '_all' ? 'bootstrap-sprockets' : 'bootstrap';
Expand Down

0 comments on commit f6b39bd

Please sign in to comment.