This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
5 changed files
with
14 additions
and
12 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
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* Adding SRI Hash to css & js files and cache-busting them | ||
* Kirby SRI - Adding SRI Hash to css & js files and cache-busting them | ||
* | ||
* @version 0.3.0 | ||
* @author S1SYPHOS <[email protected]> | ||
* @package Kirby CMS | ||
* @author S1SYPHOS <[email protected]> | ||
* @link http://twobrain.io | ||
* @version 0.4.0 | ||
*/ | ||
|
||
if(!c::get('sri-hash')) return; | ||
if(!c::get('plugin.kirby-sri')) return; | ||
|
||
function sri_checksum($input) { | ||
$algorithm = c::get('sri-hash.algorithm') ? c::get('sri-hash.algorithm') : 'sha512'; | ||
$algorithm = c::get('plugin.kirby-sri.algorithm') ? c::get('plugin.kirby-sri.algorithm') : 'sha512'; | ||
$hash = hash($algorithm, $input, true); | ||
$hash_base64 = base64_encode($hash); | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "sri-hash", | ||
"description": "Kirby SRI Hash & Cache-bust Plugin", | ||
"author": "S1SYPHOS <[email protected]>", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"type": "kirby-plugin", | ||
"license": "MIT" | ||
} |