dsfr_accessible_skip_links 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c1aa834669fc2810bad9ffe69cad4af0d1640ea1b294d514c755b72e80cea81
|
|
4
|
+
data.tar.gz: 57a4ffa98aa9217fd8937a137df89a810ddf04fbda942e5b1736baabbf5c3911
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2fa2f71d3ed56fe3dbbc9966e57ff9743a2bdc360a16fb17574396fcbb978d1659abfd5e865e5c2addb95a69dd350b9b39e9bc681a852598a2245b9a276ebd5
|
|
7
|
+
data.tar.gz: d4ca7582ffe46826b82801d41f673b29cbae349e01be2d0c77f54450d09f1e0ad957440b74fc0f5128b64c2ecdf2549d550ddb1eb0e631474b944f4921dfaffb
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.3] - 2025-08-27
|
|
11
|
+
### Fixed
|
|
12
|
+
- Generator now uses `copy_file` instead of `template` to avoid evaluating ERB in the partial during generation. This prevents `NameError` for `skip_links_content`.
|
|
13
|
+
- Ensure DsfrAccessibleSkipLinks::SkipLinks is automatically included using `ActiveSupport.on_load` hooks:
|
|
14
|
+
- Included into `ActionController::Base` (controller-side) and exposed as view helpers
|
|
15
|
+
- Included into `ActionView` (view-side) so helpers are available in templates without manual setup
|
|
16
|
+
|
|
10
17
|
## [0.1.2] - 2025-08-27
|
|
11
18
|
### Added
|
|
12
19
|
- Rails generator `dsfr_accessible_skip_links:install` to copy the skip links partial and inject the render call into the application layout.
|
data/README.md
CHANGED
|
@@ -26,7 +26,7 @@ You can also install the gem itself directly as:
|
|
|
26
26
|
|
|
27
27
|
### Rails Integration
|
|
28
28
|
|
|
29
|
-
The gem automatically integrates with Rails through a Rails Engine. The `SkipLinks` module is automatically included in
|
|
29
|
+
The gem automatically integrates with Rails through a Rails Engine. The `SkipLinks` module is automatically included in controllers and views (via Rails on_load hooks), so you can call the helpers directly from templates and controllers.
|
|
30
30
|
|
|
31
31
|
In your layout file (e.g., `app/views/layouts/application.html.erb`), add the skip links at the top:
|
|
32
32
|
|
|
@@ -14,8 +14,16 @@ module DsfrAccessibleSkipLinks
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
# Ensure helpers are available automatically in controllers and views
|
|
18
|
+
initializer "dsfr_accessible_skip_links.helpers" do
|
|
19
|
+
ActiveSupport.on_load(:action_controller_base) do
|
|
20
|
+
include DsfrAccessibleSkipLinks::SkipLinks
|
|
21
|
+
helper DsfrAccessibleSkipLinks::SkipLinks if respond_to?(:helper)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
ActiveSupport.on_load(:action_view) do
|
|
25
|
+
include DsfrAccessibleSkipLinks::SkipLinks
|
|
26
|
+
end
|
|
19
27
|
end
|
|
20
28
|
end
|
|
21
29
|
end
|
|
@@ -12,7 +12,8 @@ module DsfrAccessibleSkipLinks
|
|
|
12
12
|
"and injecting the render call into the application layout."
|
|
13
13
|
)
|
|
14
14
|
def copy_partial
|
|
15
|
-
template
|
|
15
|
+
# Use copy_file instead of template to avoid evaluating ERB in the generator context
|
|
16
|
+
copy_file "_skip_links.html.erb", "app/views/shared/_skip_links.html.erb"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
# rubocop:disable Metrics/MethodLength
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dsfr_accessible_skip_links
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Isabelle Lafont
|
|
@@ -127,7 +127,7 @@ metadata:
|
|
|
127
127
|
changelog_uri: https://github.com/Isalafont/dsfr_accessible_skip_links/blob/main/CHANGELOG.md
|
|
128
128
|
rubygems_mfa_required: 'true'
|
|
129
129
|
post_install_message: |
|
|
130
|
-
Thank you for installing dsfr_accessible_skip_links (v0.1.
|
|
130
|
+
Thank you for installing dsfr_accessible_skip_links (v0.1.3)!
|
|
131
131
|
|
|
132
132
|
To complete setup in your Rails app, run:
|
|
133
133
|
bin/rails g dsfr_accessible_skip_links:install
|