{"id":16798989,"url":"https://github.com/sjelfull/craft-sri","last_synced_at":"2025-04-11T00:21:00.946Z","repository":{"id":84047394,"uuid":"54318234","full_name":"sjelfull/Craft-SRI","owner":"sjelfull","description":"Generate the SRI (Subresource Integrity Hash) for remote JS/CSS files.","archived":false,"fork":false,"pushed_at":"2017-02-23T22:56:18.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T21:05:11.759Z","etag":null,"topics":["craftcms","craftcms-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjelfull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-20T13:12:59.000Z","updated_at":"2019-09-17T16:15:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"55f7c8b8-99ba-4a60-94a5-79a13384cf64","html_url":"https://github.com/sjelfull/Craft-SRI","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2FCraft-SRI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2FCraft-SRI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2FCraft-SRI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2FCraft-SRI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjelfull","download_url":"https://codeload.github.com/sjelfull/Craft-SRI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248318886,"owners_count":21083742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craftcms","craftcms-plugin"],"created_at":"2024-10-13T09:27:30.130Z","updated_at":"2025-04-11T00:21:00.938Z","avatar_url":"https://github.com/sjelfull.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SRI plugin for Craft CMS\n\nGenerate the SRI (Subresource Integrity Hash) for remote JS/CSS files.\n\n## Installation\n\nTo install SRI, follow these steps:\n\n1. Download \u0026 unzip the file and place the `sri` directory into your `craft/plugins` directory\n2.  -OR- do a `git clone https://github.com/sjelfull/Craft-SRI.git` directly into your `craft/plugins` folder.  You can then update it with `git pull`\n3. Install plugin in the Craft Control Panel under Settings \u003e Plugins\n4. The plugin folder should be named `sri` for Craft to see it.  GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.\n\nSRI works on Craft 2.4.x and Craft 2.5.x.\n\n## SRI Overview\n\nSRI is a new W3C specification that allows web developers to ensure that resources hosted on third-party servers have not been tampered with. Use of SRI is recommended as a best-practice, whenever libraries are loaded from a third-party source.\n\nLearn more about how to use [subresource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) on MDN.\n\n## Using SRI\n\nYou can apply the `sri` filter to either a `\u003cscript\u003e` or a `\u003clink\u003e` tag, like so:\n\n```{{ '\u003cscript src=\"https://code.jquery.com/jquery-2.1.4.min.js\"\u003e\u003c/script\u003e' | sri }}```\n\n```{{ '\u003clink rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\" media=\"screen\" title=\"no title\" charset=\"utf-8\"\u003e' | sri }}```\n\nThe request will be cached for 24 hours. You may override this in general.php by setting the duration like so:\n\n```php\n    'sriCacheDuration' =\u003e 3600 * 24, // 24 hours by default\n```\n\n## SRI Roadmap\n\n- Add option for calculating hashes with multiple algorithms\n- Add support for multiple tags inside filter section\n- ~~Make cache duration configurable.~~\n\n## SRI Changelog\n\n### 1.0.0 -- 2016.03.20\n\n* Initial release\n\nBrought to you by [Fred Carlsen](http://sjelfull.no)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft-sri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjelfull%2Fcraft-sri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft-sri/lists"}