bridgetown-slim 1.1.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5dfa87c7f9faed246db9f0d1c30e16d28e0abc094efb4692dd1e6617b60db1b
4
- data.tar.gz: feaf202a1792217bcffa1f65b034df582d3352e6168b86a584768618ae591536
3
+ metadata.gz: d098300e07491d5b6e9731c9384333e3b4becb3427cb5a2419b2e0b96ca92691
4
+ data.tar.gz: e186bb6ed088103b8e39f0aeb21e75f6ebcbe5be7fcddff5ab0b3541cebd38c8
5
5
  SHA512:
6
- metadata.gz: 6c44abe7a01ccfd23f2226391165b6f27f7946426df3bb721edc3b8e2ad7a5376a6f119e10e46b7ba6d7ce073dfbc475143f9b70433f5a6414bf95a438ff6af6
7
- data.tar.gz: 3e5e9fb1b5984b6f63dc50b417edb5d51b35d8b88520edd95398030b7eac5f59100211f8064735f47a9df10dd6aae3ec480ceee88e1c27c0de3ade4bb05bd882
6
+ metadata.gz: 23097d50bcc9b6ef909ff3ada6a4aaf0a0b108ca94305e91cda90caf49880d60eb3452a2ae8815475c4c69e1dd537e7d0a783f88f74711944eee35684f0f00a8
7
+ data.tar.gz: 9b98143974356897f581234d70125fa1183289f67d902457a687c2533f67e36b933851a2dd0e5c4e97a1d465642f77805971666d30c405bce9c77f187c314460
data/.rubocop.yml CHANGED
@@ -4,19 +4,20 @@ inherit_gem:
4
4
  rubocop-bridgetown: .rubocop.yml
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.5
8
- Include:
9
- - lib/**/*.rb
7
+ TargetRubyVersion: 2.7
10
8
 
11
9
  Exclude:
12
10
  - .gitignore
13
11
  - .rspec
14
12
  - .rubocop.yml
15
13
 
14
+ - Rakefile
15
+ - "*.gemspec"
16
16
  - Gemfile.lock
17
17
  - CHANGELOG.md
18
18
  - LICENSE.txt
19
19
  - README.md
20
20
 
21
21
  - script/**/*
22
+ - spec/**/*
22
23
  - vendor/**/*
data/CHANGELOG.md CHANGED
@@ -1,17 +1,27 @@
1
- # main
1
+ # Changelog
2
2
 
3
- # 1.1.0 / 2020-10-30
3
+ ## Unreleased
4
+
5
+ ## 2.0.0 / 2023-01-22
6
+
7
+ * Upgrade to initializers system in Bridgetown 1.2
8
+
9
+ ## 1.1.1 / 2020-11-01
10
+
11
+ * Set template_engine frontmatter when matching on extension alone
12
+
13
+ ## 1.1.0 / 2020-10-30
4
14
 
5
15
  * Updated for compatibilty with Bridgetown 0.18
6
16
 
7
- # 1.0.2 / 2020-07-24
17
+ ## 1.0.2 / 2020-07-24
8
18
 
9
19
  * Fix broken link to GitHub repo
10
20
 
11
- # 1.0.1 / 2020-07-24
21
+ ## 1.0.1 / 2020-07-24
12
22
 
13
23
  * Use filename to help with error stacktraces
14
24
 
15
- # 1.0.0 / 2020-07-21
25
+ ## 1.0.0 / 2020-07-21
16
26
 
17
27
  * First release of the bridgetown-slim plugin
data/README.md CHANGED
@@ -2,16 +2,22 @@
2
2
 
3
3
  A Bridgetown plugin to provide support for [Slim templates](http://slim-lang.com).
4
4
 
5
- _Requires Bridgetown 0.16 or greater._
6
-
7
- ## Installation
5
+ ## Installation for Bridgetown 1.2+
8
6
 
9
7
  Run this command to add this plugin to your site's Gemfile:
10
8
 
11
9
  ```shell
12
- $ bundle add bridgetown-slim -g bridgetown_plugins
10
+ $ bundle add bridgetown-slim
11
+ ```
12
+
13
+ And then add the initializer to your configuration in `config/initializers.rb`:
14
+
15
+ ```ruby
16
+ init :"bridgetown-slim"
13
17
  ```
14
18
 
19
+ (For Bridgetown 1.1 or earlier, [read these instructions](https://github.com/bridgetownrb/bridgetown-slim/tree/v1.1.1).)
20
+
15
21
  ## Usage
16
22
 
17
23
  Simply name your page, layout, or partial with a `.slim` extension. The available features will be fairly analogous to [the ERB support](https://www.bridgetownrb.com/docs/erb-and-beyond#haml-and-slim) in Bridgetown, including support for helpers, partials, and rendering Liquid components. You can even [embed Markdown and other template languages](https://github.com/slim-template/slim#embedded-engines-markdown-) using standard Slim syntax.
@@ -31,3 +37,8 @@ You can also add `template_engine: slim` to your file's front matter and use any
31
37
  4. Commit your changes (`git commit -am 'Add some feature'`)
32
38
  5. Push to the branch (`git push origin my-new-feature`)
33
39
  6. Create a new Pull Request
40
+
41
+
42
+ ## Examples
43
+
44
+ - Template using Slim, Bridgetown, Tailwind 2.0, and Snowpack. https://github.com/ParamagicDev/bridgetown-slim-starter
@@ -15,14 +15,14 @@ Gem::Specification.new do |spec|
15
15
  spec.test_files = spec.files.grep(%r!^spec/!)
16
16
  spec.require_paths = ["lib"]
17
17
 
18
- spec.required_ruby_version = ">= 2.5.0"
18
+ spec.required_ruby_version = ">= 2.7.0"
19
19
 
20
- spec.add_dependency "bridgetown", ">= 0.18", "< 2.0"
20
+ spec.add_dependency "bridgetown", ">= 1.2.0.beta5", "< 2.0"
21
21
  spec.add_dependency "slim", ">= 4.1.0"
22
22
 
23
23
  spec.add_development_dependency "bundler"
24
24
  spec.add_development_dependency "nokogiri", "~> 1.6"
25
- spec.add_development_dependency "rake", "~> 12.0"
25
+ spec.add_development_dependency "rake", "~> 13.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  spec.add_development_dependency "rubocop-bridgetown", "~> 0.2"
28
28
  end
@@ -19,6 +19,7 @@ module Bridgetown
19
19
 
20
20
  module Converters
21
21
  class SlimTemplates < Converter
22
+ priority :highest
22
23
  input :slim
23
24
 
24
25
  # Logic to do the Slim content conversion.
@@ -29,6 +30,8 @@ module Bridgetown
29
30
  #
30
31
  # @return [String] The converted content.
31
32
  def convert(content, convertible)
33
+ return content if convertible.data[:template_engine] != "slim"
34
+
32
35
  slim_view = Bridgetown::SlimView.new(convertible)
33
36
 
34
37
  slim_renderer = Slim::Template.new(convertible.relative_path) { content }
@@ -45,7 +48,9 @@ module Bridgetown
45
48
  def matches(ext, convertible)
46
49
  return true if convertible.data[:template_engine] == "slim"
47
50
 
48
- super(ext)
51
+ super(ext).tap do |ext_matches|
52
+ convertible.data[:template_engine] = "slim" if ext_matches
53
+ end
49
54
  end
50
55
 
51
56
  def output_ext(ext)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownSlim
4
- VERSION = "1.1.0"
4
+ VERSION = "2.0.0"
5
5
  end
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bridgetown"
4
- require "bridgetown-slim/slim_templates"
4
+
5
+ Bridgetown.initializer :"bridgetown-slim" do
6
+ require "bridgetown-slim/slim_templates"
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-slim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-30 00:00:00.000000000 Z
11
+ date: 2023-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.18'
19
+ version: 1.2.0.beta5
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.18'
29
+ version: 1.2.0.beta5
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '12.0'
81
+ version: '13.0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '12.0'
88
+ version: '13.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rspec
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0.2'
117
- description:
117
+ description:
118
118
  email: maintainers@bridgetownrb.com
119
119
  executables: []
120
120
  extensions: []
@@ -136,7 +136,7 @@ homepage: https://github.com/bridgetownrb/bridgetown-slim
136
136
  licenses:
137
137
  - MIT
138
138
  metadata: {}
139
- post_install_message:
139
+ post_install_message:
140
140
  rdoc_options: []
141
141
  require_paths:
142
142
  - lib
@@ -144,15 +144,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: 2.5.0
147
+ version: 2.7.0
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
- rubygems_version: 3.1.4
155
- signing_key:
154
+ rubygems_version: 3.3.3
155
+ signing_key:
156
156
  specification_version: 4
157
157
  summary: A Bridgetown plugin which provides support for Slim templates.
158
158
  test_files: []