{"id":27952018,"url":"https://github.com/swup/head-plugin","last_synced_at":"2025-10-10T14:37:56.551Z","repository":{"id":34909549,"uuid":"188609342","full_name":"swup/head-plugin","owner":"swup","description":"A swup plugin for updating the contents of the head tag 🐶","archived":false,"fork":false,"pushed_at":"2025-08-04T13:32:24.000Z","size":1562,"stargazers_count":8,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-15T19:45:39.557Z","etag":null,"topics":["animation","head","metadata","page-transitions","plugin","seo","swup"],"latest_commit_sha":null,"homepage":"https://swup.js.org/plugins/head-plugin","language":"TypeScript","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/swup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null},"funding":{"github":["gmrchk","daun","hirasso"],"open_collective":"swup"}},"created_at":"2019-05-25T20:27:28.000Z","updated_at":"2025-08-06T09:35:05.000Z","dependencies_parsed_at":"2024-06-18T21:33:48.537Z","dependency_job_id":"34230a10-5059-49dc-9d97-c88e79d9cd32","html_url":"https://github.com/swup/head-plugin","commit_stats":{"total_commits":116,"total_committers":7,"mean_commits":"16.571428571428573","dds":0.3448275862068966,"last_synced_commit":"bc2e7cd2121520e9bc6d9fd9a8e30e8121fa2cf1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/swup/head-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swup%2Fhead-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swup%2Fhead-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swup%2Fhead-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swup%2Fhead-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swup","download_url":"https://codeload.github.com/swup/head-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swup%2Fhead-plugin/sbom","scorecard":{"id":113639,"data":{"date":"2025-08-04","repo":{"name":"github.com/swup/head-plugin","commit":"d42425850e3651f035dfc604f92b778f4df5a923"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":5,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/npm-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/redeploy-docs.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/redeploy-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/unit-tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/unit-tests.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/unit-tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/version-update.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/version-update.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/version-update.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/version-update.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/version-update.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/swup/head-plugin/version-update.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/redeploy-docs.yml:1","Warn: no topLevel permission defined: .github/workflows/unit-tests.yml:1","Warn: no topLevel permission defined: .github/workflows/version-update.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/npm-publish.yml:10"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T19:45:40.527Z","repository_id":34909549,"created_at":"2025-08-15T19:45:40.527Z","updated_at":"2025-08-15T19:45:40.527Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274139222,"owners_count":25228967,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["animation","head","metadata","page-transitions","plugin","seo","swup"],"created_at":"2025-05-07T16:27:19.387Z","updated_at":"2025-10-10T14:37:51.527Z","avatar_url":"https://github.com/swup.png","language":"TypeScript","funding_links":["https://github.com/sponsors/gmrchk","https://github.com/sponsors/daun","https://github.com/sponsors/hirasso","https://opencollective.com/swup"],"categories":[],"sub_categories":[],"readme":"# Swup Head Plugin\n\nA [swup](https://swup.js.org) plugin for updating the contents of the head tag.\n\n- Adds any meta tags and assets from the next page to the current document\n- Updates the lang and dir attributes of the html element\n- Supports delaying the transition until new stylesheets have loaded\n\n## Installation\n\nInstall the plugin from npm and import it into your bundle.\n\n```bash\nnpm install @swup/head-plugin\n```\n\n```js\nimport SwupHeadPlugin from '@swup/head-plugin';\n```\n\nOr include the minified production file from a CDN:\n\n```html\n\u003cscript src=\"https://unpkg.com/@swup/head-plugin@2\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nTo run this plugin, include an instance in the swup options.\n\n```javascript\nconst swup = new Swup({\n  plugins: [new SwupHeadPlugin()]\n});\n```\n\n## Markup\n\nWhen using `noscript` tags inside the head, make sure they only contain the\n[node types allowed inside the head element](https://html.spec.whatwg.org/multipage/dom.html#metadata-content-2).\nOtherwise, the browser will implicitly close the head element and interpret them as part of the\nbody, most probably breaking this plugin and leading to unforseen results.\nSee [the following issue](https://github.com/swup/head-plugin/issues/40) for details and a fix.\n\n## Options\n\n### persistAssets\n\nWhether to keep orphaned `link`, `style` and `script` tags from the old page\nthat weren't included on the new page. Useful for third-party libraries that\nadd custom styles but can only be run once.\n\nDefaults to `false`, i.e. orphaned assets will be removed.\n\nSetting it to `true` acts as a shortcut for setting the `persistTags` option to\na selector of `link[rel=stylesheet], script[src], style`.\n\n```javascript\nnew SwupHeadPlugin({\n  persistAssets: true\n});\n```\n\n### persistTags\n\nDefine which tags will be persisted when a new page is loaded.\n\nDefaults to `false`, i.e. all orphaned tags will be removed.\n\n```javascript\nnew SwupHeadPlugin({\n  // Keep all orphaned tags\n  persistTags: true,\n\n  // Keep all tags that match a CSS selector\n  persistTags: 'style[data-keep-style]',\n\n  // Use a function to determine whether to keep a tag\n  persistTags: (tag) =\u003e tag.children.length \u003e 1\n});\n```\n\n### awaitAssets\n\nSetting this to `true` will delay the transition to the new page until all newly\nadded assets have finished loading, imitating the standard browser behavior of render-blocking requests. Currently only supports stylesheets.\nDefaults to `false`.\n\n```javascript\nnew SwupHeadPlugin({\n  awaitAssets: true\n});\n```\n\n### attributes\n\nUpdate additional attributes of the html element. By default, the `lang` and `dir` attributes are\nupdated, but you can define a custom list of attributes here. Accepts an array of strings or\nregular expression instances.\n\n```javascript\n{\n  attributes: ['lang', 'dir', 'style', /^data-/]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswup%2Fhead-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswup%2Fhead-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswup%2Fhead-plugin/lists"}