gretel 5.0.1 → 5.1.0
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 +4 -4
- data/.github/workflows/ci.yml +9 -6
- data/CHANGELOG.md +5 -0
- data/Gemfile +15 -2
- data/README.md +46 -4
- data/gretel.gemspec +1 -5
- data/lib/gretel/renderer.rb +2 -1
- data/lib/gretel/version.rb +1 -1
- metadata +4 -63
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 812c05ccf2460901807cd39c2b0774d50b8f615a166379f3d2cb2a8f69e3e6a0
|
|
4
|
+
data.tar.gz: a595c946b125080c81fad70a98c55da8c5f39129d70fa89a226521dadbbaf0a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8c8ba2633722999cf659551f256249ff5875b68bd0a0d2bca1d7306dd74fbca117557adfcee713aceef293c8b1d71540eeec94aa018698fa557f877869c0ecb
|
|
7
|
+
data.tar.gz: c233d2dbadd1e2201ec7bbf65bc573e966f3f8662be9c0244bbd75b531e058b0f8e15239adb5f732c739ad9a601e7e5ebcca3df58264f8f2c7c122399a57bf8f
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -2,7 +2,7 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [main]
|
|
6
6
|
pull_request:
|
|
7
7
|
schedule:
|
|
8
8
|
- cron: '0 0 * * 0'
|
|
@@ -12,14 +12,17 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
rails_version: [6.1.0, 7.0.0, 7.1.0, 7.2.0,
|
|
16
|
-
ruby_version: ['3.
|
|
15
|
+
rails_version: [6.1.0, 7.0.0, 7.1.0, 7.2.0, 8.0.0, 8.1.0, main]
|
|
16
|
+
ruby_version: ['3.4', '3.3', '3.2', '3.1']
|
|
17
17
|
exclude:
|
|
18
|
-
- { ruby_version: '3.
|
|
19
|
-
- { ruby_version: '3.
|
|
18
|
+
- { ruby_version: '3.1', rails_version: main }
|
|
19
|
+
- { ruby_version: '3.1', rails_version: 8.1.0 }
|
|
20
|
+
- { ruby_version: '3.1', rails_version: 8.0.0 }
|
|
21
|
+
- { ruby_version: '3.4', rails_version: 6.1.0 }
|
|
22
|
+
- { ruby_version: '3.4', rails_version: 7.0.0 }
|
|
20
23
|
|
|
21
24
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v5
|
|
23
26
|
|
|
24
27
|
- name: Setup Ruby
|
|
25
28
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## Version 5.1.0
|
|
6
|
+
* Detach fork
|
|
7
|
+
* Fix README about JSON-LD (via #8, thanks @mario-amazing)
|
|
8
|
+
* Support Bulma. See the `:style` option in the readme for more info (via #15, thanks @lporras)
|
|
9
|
+
|
|
5
10
|
## Version 5.0.1
|
|
6
11
|
* Support Rails 7.2 (via #45, thanks @alec-c4)
|
|
7
12
|
|
data/Gemfile
CHANGED
|
@@ -3,6 +3,19 @@ source "http://rubygems.org"
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
5
|
rails_version = ENV['RAILS_VERSION'] || '>= 0'
|
|
6
|
-
|
|
6
|
+
case rails_version
|
|
7
|
+
when 'main', '>= 0'
|
|
8
|
+
gem 'rails', rails_version == 'main' ? { github: 'rails/rails' } : rails_version
|
|
9
|
+
gem 'sqlite3', '>= 2.0'
|
|
10
|
+
when '6.1.0', '7.0.0'
|
|
11
|
+
gem 'rails', "~> #{rails_version}"
|
|
12
|
+
gem 'sqlite3', '~> 1.4'
|
|
13
|
+
gem 'concurrent-ruby', '1.3.4' # SEE: https://stackoverflow.com/a/79361034
|
|
14
|
+
else
|
|
15
|
+
gem 'rails', "~> #{rails_version}"
|
|
16
|
+
gem 'sqlite3', rails_version < '8' ? '~> 1.4' : '>= 2.0'
|
|
17
|
+
end
|
|
7
18
|
|
|
8
|
-
gem 'rails'
|
|
19
|
+
gem 'rspec-rails'
|
|
20
|
+
gem 'simplecov'
|
|
21
|
+
gem 'simplecov-erb'
|
data/README.md
CHANGED
|
@@ -81,7 +81,7 @@ You can pass options to `<%= breadcrumbs %>`, e.g. `<%= breadcrumbs pretext: "Yo
|
|
|
81
81
|
|
|
82
82
|
Option | Description | Default
|
|
83
83
|
------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -------
|
|
84
|
-
:style | How to render the breadcrumbs. Can be `:inline`, `:ol`, `:ul`, or `:
|
|
84
|
+
:style | How to render the breadcrumbs. Can be `:inline`, `:ol`, `:ul`, `:bootstrap`, `:bootstrap4`, `:bootstrap5`, `:foundation5`, or `:bulma`. See below for more info. | `:inline`
|
|
85
85
|
:pretext | Text to be rendered before breadcrumb, e.g. `"You are here: "`. | None
|
|
86
86
|
:posttext | Text to be appended after breadcrumb, e.g. `"Text after breacrumb"`, | None
|
|
87
87
|
:separator | Separator between links, e.g. `" › "`. | `" › "`
|
|
@@ -115,11 +115,47 @@ Style | Description
|
|
|
115
115
|
`:bootstrap4` | Renders the links for use in [Bootstrap v4](https://getbootstrap.com/docs/4.6/getting-started/introduction/).
|
|
116
116
|
`:bootstrap5` | Renders the links for use in [Bootstrap v5](https://getbootstrap.com/).
|
|
117
117
|
`:foundation5` | Renders the links for use in [Foundation 5](https://get.foundation/).
|
|
118
|
+
`:bulma` | Renders the links for use in [Bulma](https://bulma.io/documentation/components/breadcrumb/).
|
|
119
|
+
|
|
120
|
+
#### Bulma Style
|
|
121
|
+
|
|
122
|
+
The `:bulma` style renders breadcrumbs compatible with [Bulma CSS](https://bulma.io/documentation/components/breadcrumb/).
|
|
123
|
+
|
|
124
|
+
**Basic usage:**
|
|
125
|
+
|
|
126
|
+
```erb
|
|
127
|
+
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
128
|
+
<%= breadcrumbs style: :bulma %>
|
|
129
|
+
</nav>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This generates HTML like:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
136
|
+
<ul>
|
|
137
|
+
<li><a href="/">Home</a></li>
|
|
138
|
+
<li><a href="/issues">All issues</a></li>
|
|
139
|
+
<li class="is-active"><a href="/issues/123" aria-current="page">My Issue</a></li>
|
|
140
|
+
</ul>
|
|
141
|
+
</nav>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Customize separators:**
|
|
145
|
+
|
|
146
|
+
```erb
|
|
147
|
+
<nav class="breadcrumb has-arrow-separator" aria-label="breadcrumbs">
|
|
148
|
+
<%= breadcrumbs style: :bulma %>
|
|
149
|
+
</nav>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
118
153
|
|
|
119
154
|
Or you can build the breadcrumbs manually for full customization; see below.
|
|
120
155
|
|
|
121
156
|
If you add other widely used styles, please submit a [Pull Request](https://github.com/kzkn/gretel/pulls) so others can use them too.
|
|
122
157
|
|
|
158
|
+
|
|
123
159
|
## More examples
|
|
124
160
|
|
|
125
161
|
In *config/breadcrumbs.rb*:
|
|
@@ -233,7 +269,7 @@ add them back is to use JSON-LD structured data:
|
|
|
233
269
|
|
|
234
270
|
```erb
|
|
235
271
|
<script type="application/ld+json">
|
|
236
|
-
<%= breadcrumbs.structured_data(url_base: "https://example.com") %>
|
|
272
|
+
<%= raw breadcrumbs.structured_data(url_base: "https://example.com").to_json %>
|
|
237
273
|
</script>
|
|
238
274
|
```
|
|
239
275
|
|
|
@@ -241,7 +277,7 @@ Or, you can infer `url_base` from `request`:
|
|
|
241
277
|
|
|
242
278
|
```erb
|
|
243
279
|
<script type="application/ld+json">
|
|
244
|
-
<%= breadcrumbs.structured_data(url_base: "#{request.protocol}#{request.host_with_port}") %>
|
|
280
|
+
<%= raw breadcrumbs.structured_data(url_base: "#{request.protocol}#{request.host_with_port}").to_json %>
|
|
245
281
|
</script>
|
|
246
282
|
```
|
|
247
283
|
|
|
@@ -340,7 +376,7 @@ This will generate the following HTML (indented for readability):
|
|
|
340
376
|
## Documentation
|
|
341
377
|
|
|
342
378
|
* [Full documentation](https://rubydoc.info/gems/gretel)
|
|
343
|
-
* [Changelog](https://github.com/kzkn/gretel/blob/
|
|
379
|
+
* [Changelog](https://github.com/kzkn/gretel/blob/main/CHANGELOG.md)
|
|
344
380
|
* [Tutorial on using Gretel](https://www.sitepoint.com/breadcrumbs-rails-gretel/) (Sitepoint)
|
|
345
381
|
|
|
346
382
|
## Versioning
|
|
@@ -366,6 +402,12 @@ To contribute:
|
|
|
366
402
|
|
|
367
403
|
Thanks.
|
|
368
404
|
|
|
405
|
+
## History
|
|
406
|
+
|
|
407
|
+
This repository had been a fork of [lassebunk/gretel](https://github.com/lassebunk/gretel) for a long time. However, due to some reasons, the maintenance of this repository was stopped and the official repository of gretel was transferred to [WilHall/gretel](https://github.com/WilHall/gretel), which is the fork of lassebunk/gretel. WilHall/gretel was then transferred to kzkn/gretel, where it continues to be maintained. During this time, kzkn/gretel was a fork of lassebunk/gretel, so `lassebunk/gretel:master` was selected by default when a pull request was made. This caused unnecessary confusion for contributors to gretel.
|
|
408
|
+
|
|
409
|
+
As mentioned earlier, lassebunk/gretel is no longer maintained. I have decided to detach the fork for the future of gretel, with all due respect to [@lassebunk](https://github.com/lassebunk) for creating gretel.
|
|
410
|
+
|
|
369
411
|
## Contributors
|
|
370
412
|
|
|
371
413
|
Gretel was created by [@lassebunk](https://github.com/lassebunk) and was maintained by [@WilHall](https://github.com/WilHall).
|
data/gretel.gemspec
CHANGED
|
@@ -16,13 +16,9 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.require_paths = ["lib"]
|
|
17
17
|
|
|
18
18
|
gem.metadata = {
|
|
19
|
-
"changelog_uri" => "https://github.com/kzkn/gretel/blob/
|
|
19
|
+
"changelog_uri" => "https://github.com/kzkn/gretel/blob/main/CHANGELOG.md",
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
gem.add_dependency "railties", ">= 6.1"
|
|
23
23
|
gem.add_dependency "actionview", ">= 6.1"
|
|
24
|
-
gem.add_development_dependency "sqlite3", '~> 1.4'
|
|
25
|
-
gem.add_development_dependency "rspec-rails"
|
|
26
|
-
gem.add_development_dependency "simplecov"
|
|
27
|
-
gem.add_development_dependency "simplecov-erb"
|
|
28
24
|
end
|
data/lib/gretel/renderer.rb
CHANGED
|
@@ -30,7 +30,8 @@ module Gretel
|
|
|
30
30
|
bootstrap: { container_tag: :ol, fragment_tag: :li, class: "breadcrumb", current_class: "active" },
|
|
31
31
|
bootstrap4: { container_tag: :ol, fragment_tag: :li, class: "breadcrumb", fragment_class: "breadcrumb-item", current_class: "active" },
|
|
32
32
|
bootstrap5: { container_tag: :ol, fragment_tag: :li, class: "breadcrumb", fragment_class: "breadcrumb-item", current_class: "active" },
|
|
33
|
-
foundation5: { container_tag: :ul, fragment_tag: :li, class: "breadcrumbs", current_class: "current" }
|
|
33
|
+
foundation5: { container_tag: :ul, fragment_tag: :li, class: "breadcrumbs", current_class: "current" },
|
|
34
|
+
bulma: { container_tag: :ul, fragment_tag: :li, class: nil, current_class: "is-active", aria_current: "page", link_current: true }
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
def initialize(context, breadcrumb_key, *breadcrumb_args)
|
data/lib/gretel/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gretel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lasse Bunk
|
|
8
8
|
- Kazuki Nishikawa
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2025-12-09 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: railties
|
|
@@ -39,62 +38,6 @@ dependencies:
|
|
|
39
38
|
- - ">="
|
|
40
39
|
- !ruby/object:Gem::Version
|
|
41
40
|
version: '6.1'
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: sqlite3
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - "~>"
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '1.4'
|
|
49
|
-
type: :development
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - "~>"
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '1.4'
|
|
56
|
-
- !ruby/object:Gem::Dependency
|
|
57
|
-
name: rspec-rails
|
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - ">="
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '0'
|
|
63
|
-
type: :development
|
|
64
|
-
prerelease: false
|
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - ">="
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: '0'
|
|
70
|
-
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: simplecov
|
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - ">="
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: '0'
|
|
77
|
-
type: :development
|
|
78
|
-
prerelease: false
|
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
-
requirements:
|
|
81
|
-
- - ">="
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: '0'
|
|
84
|
-
- !ruby/object:Gem::Dependency
|
|
85
|
-
name: simplecov-erb
|
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
|
87
|
-
requirements:
|
|
88
|
-
- - ">="
|
|
89
|
-
- !ruby/object:Gem::Version
|
|
90
|
-
version: '0'
|
|
91
|
-
type: :development
|
|
92
|
-
prerelease: false
|
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
94
|
-
requirements:
|
|
95
|
-
- - ">="
|
|
96
|
-
- !ruby/object:Gem::Version
|
|
97
|
-
version: '0'
|
|
98
41
|
description: Gretel is a Ruby on Rails plugin that makes it easy yet flexible to create
|
|
99
42
|
breadcrumbs.
|
|
100
43
|
email:
|
|
@@ -128,8 +71,7 @@ homepage: https://github.com/kzkn/gretel
|
|
|
128
71
|
licenses:
|
|
129
72
|
- MIT
|
|
130
73
|
metadata:
|
|
131
|
-
changelog_uri: https://github.com/kzkn/gretel/blob/
|
|
132
|
-
post_install_message:
|
|
74
|
+
changelog_uri: https://github.com/kzkn/gretel/blob/main/CHANGELOG.md
|
|
133
75
|
rdoc_options: []
|
|
134
76
|
require_paths:
|
|
135
77
|
- lib
|
|
@@ -144,8 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
144
86
|
- !ruby/object:Gem::Version
|
|
145
87
|
version: '0'
|
|
146
88
|
requirements: []
|
|
147
|
-
rubygems_version: 3.
|
|
148
|
-
signing_key:
|
|
89
|
+
rubygems_version: 3.6.2
|
|
149
90
|
specification_version: 4
|
|
150
91
|
summary: Flexible Ruby on Rails breadcrumbs plugin.
|
|
151
92
|
test_files: []
|