forked from processing/p5.js-website-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
4,970 additions
and
7,045 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: processing | ||
custom: https://processingfoundation.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ deploy: | |
keep-history: true | ||
local-dir: dist/ | ||
on: | ||
branch: master | ||
branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports.register = function(Handlebars, options) { | ||
Handlebars.registerHelper('versionedAsset', function(options) { | ||
// node libraries | ||
const crypto = require('crypto'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const filePath = options.fn(this); | ||
const hash = crypto.createHash('sha256'); | ||
// creating full path from the root dir to the file | ||
const fullPath = path.join(__dirname, '..', 'dist', filePath); | ||
let hashCode = ''; | ||
hash.on('readable', () => { | ||
const data = hash.read(); | ||
if (data) hashCode = data.toString('hex'); | ||
}); | ||
hash.write(fs.readFileSync(fullPath, { | ||
encoding: 'utf8' | ||
})); | ||
hash.end(); | ||
// creating a version string from first 6 hash characters | ||
hashCode = '/' + filePath + '?v=' + hashCode.substr(0, 6); | ||
return hashCode; | ||
}); | ||
}; |
File renamed without changes.
Oops, something went wrong.