mirror of
https://github.com/remoteintech/remote-jobs
synced 2025-01-13 13:08:42 +00:00
Fix <link rel="shortcut icon"> image (#696)
Includes a change to copy files in binary mode when building the site.
This commit is contained in:
parent
88d2932e18
commit
43332d15a0
3 changed files with 8 additions and 4 deletions
|
@ -83,13 +83,16 @@ async function request( url ) {
|
|||
* site/assets/) and include a cache buster in the new name. Return the URL to
|
||||
* the asset file.
|
||||
*/
|
||||
function copyAssetToBuild( filename, content = null ) {
|
||||
const destFilename = filename
|
||||
.replace( /(\.[^.]+)$/, '-' + assetCacheBuster + '$1' );
|
||||
function copyAssetToBuild( filename, content = null, addSuffix = true ) {
|
||||
let destFilename = filename;
|
||||
if ( addSuffix ) {
|
||||
destFilename = destFilename
|
||||
.replace( /(\.[^.]+)$/, '-' + assetCacheBuster + '$1' );
|
||||
}
|
||||
const destPath = path.join( siteBuildPath, 'assets', destFilename );
|
||||
if ( ! content ) {
|
||||
const srcPath = path.join( sitePath, 'assets', filename );
|
||||
content = fs.readFileSync( srcPath, 'utf8' );
|
||||
content = fs.readFileSync( srcPath );
|
||||
}
|
||||
fs.writeFileSync( destPath, content );
|
||||
return '/assets/' + destFilename;
|
||||
|
@ -189,6 +192,7 @@ async function buildSite() {
|
|||
rimraf.sync( siteBuildPath );
|
||||
fs.mkdirSync( siteBuildPath );
|
||||
fs.mkdirSync( path.join( siteBuildPath, 'assets' ) );
|
||||
copyAssetToBuild( 'remoteintech.png', null, false );
|
||||
|
||||
// Set up styles/scripts to be included on all pages
|
||||
const stylesheets = [ {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 57 KiB |
Binary file not shown.
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 57 KiB |
Loading…
Reference in a new issue