mirror of
https://github.com/remoteintech/remote-jobs
synced 2025-01-27 19:45:09 +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
|
* site/assets/) and include a cache buster in the new name. Return the URL to
|
||||||
* the asset file.
|
* the asset file.
|
||||||
*/
|
*/
|
||||||
function copyAssetToBuild( filename, content = null ) {
|
function copyAssetToBuild( filename, content = null, addSuffix = true ) {
|
||||||
const destFilename = filename
|
let destFilename = filename;
|
||||||
.replace( /(\.[^.]+)$/, '-' + assetCacheBuster + '$1' );
|
if ( addSuffix ) {
|
||||||
|
destFilename = destFilename
|
||||||
|
.replace( /(\.[^.]+)$/, '-' + assetCacheBuster + '$1' );
|
||||||
|
}
|
||||||
const destPath = path.join( siteBuildPath, 'assets', destFilename );
|
const destPath = path.join( siteBuildPath, 'assets', destFilename );
|
||||||
if ( ! content ) {
|
if ( ! content ) {
|
||||||
const srcPath = path.join( sitePath, 'assets', filename );
|
const srcPath = path.join( sitePath, 'assets', filename );
|
||||||
content = fs.readFileSync( srcPath, 'utf8' );
|
content = fs.readFileSync( srcPath );
|
||||||
}
|
}
|
||||||
fs.writeFileSync( destPath, content );
|
fs.writeFileSync( destPath, content );
|
||||||
return '/assets/' + destFilename;
|
return '/assets/' + destFilename;
|
||||||
|
@ -189,6 +192,7 @@ async function buildSite() {
|
||||||
rimraf.sync( siteBuildPath );
|
rimraf.sync( siteBuildPath );
|
||||||
fs.mkdirSync( siteBuildPath );
|
fs.mkdirSync( siteBuildPath );
|
||||||
fs.mkdirSync( path.join( siteBuildPath, 'assets' ) );
|
fs.mkdirSync( path.join( siteBuildPath, 'assets' ) );
|
||||||
|
copyAssetToBuild( 'remoteintech.png', null, false );
|
||||||
|
|
||||||
// Set up styles/scripts to be included on all pages
|
// Set up styles/scripts to be included on all pages
|
||||||
const stylesheets = [ {
|
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