From 64f505e8bf0367c8dd8216edddfdb05a9a980116 Mon Sep 17 00:00:00 2001 From: daun Date: Sat, 19 Oct 2024 10:32:39 +0000 Subject: [PATCH 1/3] Update package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9091d88..c7a4d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@swup/head-plugin", - "version": "2.2.1", + "version": "2.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@swup/head-plugin", - "version": "2.2.1", + "version": "2.3.0", "license": "MIT", "dependencies": { "@swup/plugin": "^4.0.0" diff --git a/package.json b/package.json index 3643a9b..68ed485 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@swup/head-plugin", "amdName": "SwupHeadPlugin", - "version": "2.2.1", + "version": "2.3.0", "description": "A swup plugin for updating the contents of the head tag", "type": "module", "source": "src/index.ts", From bf999f88cf0d37fbf9c553e633a44d1c4b37509e Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Sat, 19 Oct 2024 12:42:15 +0200 Subject: [PATCH 2/3] Update readme --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62cebb0..4ab81f0 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A [swup](https://swup.js.org) plugin for updating the contents of the head tag. - Adds any meta tags and assets from the next page to the current document -- Updates the lang attribute of the html element +- Updates the lang and dir attributes of the html element - Supports delaying the transition until new stylesheets have loaded ## Installation @@ -91,3 +91,15 @@ new SwupHeadPlugin({ awaitAssets: true }); ``` + +### attributes + +Update additional attributes of the html element. By default, the `lang` and `dir` attributes are +updated, but you can define a custom list of attributes here. Accepts an array of strings or +regular expression instances. + +```javascript +{ + attributes: ['lang', 'dir', 'style', /^data-/] +} +``` From ad873f768d58e95222cff07c5660383e0594a53e Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Sat, 19 Oct 2024 12:42:26 +0200 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d4cf4a..7479e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.3.0] - 2024-10-19 + +- Update html element's `dir` attribute +- Allow updating additional html element attributes + ## [2.2.1] - 2024-09-09 - Ignore empty string passed into `persistTags` option (@NukeJS) @@ -46,6 +51,7 @@ - Initial release +[2.3.0]: https://github.com/swup/head-plugin/releases/tag/2.3.0 [2.2.1]: https://github.com/swup/head-plugin/releases/tag/2.2.1 [2.2.0]: https://github.com/swup/head-plugin/releases/tag/2.2.0 [2.1.2]: https://github.com/swup/head-plugin/releases/tag/2.1.2