bridgetown-core 2.0.0.beta1 → 2.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 390375353b8c9d8064d5ae48c531c73337cb0b55eec6d803e11e327244a6d39f
4
- data.tar.gz: 820fbb87dde20f864e6928038310fe5d18bfb4d0490c47e35fcce56843287bb7
3
+ metadata.gz: ad323d78c36221049d27482e186a24793c5e52b478e913b778ba0d8809658990
4
+ data.tar.gz: dfc80b46023d5f28e38f2116e62676f579d175f1fcca023c46bb921298c99dc7
5
5
  SHA512:
6
- metadata.gz: e54b13230360699dd9162a1d525b61b0af97e010479016e90b1b75bd798111617f0975e6ea73b7d4e22e13fa91db6cb426887118f203627dbd25c214709ade2b
7
- data.tar.gz: dae2470b585eb7ee3cdc2a6b5a9926420a1f47ba09f5f7f7e552c1b037e15067a19b5de84dbf65f5fd02ddb2096f0e4c5e3e2fb9c0b9a88c3f1e683b25486d54
6
+ metadata.gz: b0a025a6629018fc3cd5687f6675aee4ce0f4ef0edb740c35b1ba45f1f77df3fc6bb85b658d52a469d9b7f2e83820efcb636a9e062d1b196372fb8cb0b3b447e
7
+ data.tar.gz: a7af845632eda73b48f00fe07863f2b90f287e35402239203be296808aa5ae57d41fb3e8a498882254ed3407022f5f88d0895e0e81d59d861f83794f6bdbef76
data/Rakefile CHANGED
@@ -3,7 +3,8 @@
3
3
  require "bundler/gem_tasks"
4
4
 
5
5
  $LOAD_PATH.unshift File.expand_path("lib", __dir__)
6
- require "bridgetown-core/version"
6
+ $LOAD_PATH.unshift File.expand_path("../bridgetown-foundation/lib", __dir__)
7
+ require "bridgetown/version"
7
8
 
8
9
  task spec: :test
9
10
  require "rake/testtask"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/bridgetown-core/version"
3
+ require_relative "../bridgetown-foundation/lib/bridgetown/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "bridgetown-core"
@@ -52,11 +52,18 @@ module Bridgetown
52
52
  resources.group_by(&:relative_url).transform_values(&:first)
53
53
  end
54
54
 
55
- # Iterate over Resources, support Enumerable
55
+ # Iterate over Resources by delegating to `resources.each` (supports Enumerable)
56
56
  def each(...) = resources.each(...)
57
57
 
58
+ # Delgates to `resources.last`
59
+ def last(...) = resources.last(...)
60
+
61
+ # Delgates to `resources.deconstruct`
58
62
  def deconstruct = resources.deconstruct
59
63
 
64
+ # Delgates to `resources[]`
65
+ def [](...) = resources.[](...)
66
+
60
67
  # Fetch the static files in this collection.
61
68
  # Defaults to an empty array if no static files have been read in.
62
69
  #
@@ -27,6 +27,7 @@ module Bridgetown
27
27
 
28
28
  require_relative "utils/initializers"
29
29
  load_determined_bundler_environment
30
+ require_plugin_features
30
31
 
31
32
  ENV["BRIDGETOWN_NO_BUNDLER_REQUIRE"] = "true"
32
33
  true
@@ -52,6 +53,16 @@ module Bridgetown
52
53
  end
53
54
  end
54
55
 
56
+ def self.require_plugin_features
57
+ bundler_specs.select do |loaded_gem|
58
+ loaded_gem.to_spec.metadata["bridgetown_features"] == "true"
59
+ end.each do |plugin_gem|
60
+ Bridgetown::Utils::RequireGems.require_with_graceful_fail(
61
+ "bridgetown/features/#{plugin_gem.name}"
62
+ )
63
+ end
64
+ end
65
+
55
66
  def self.require_gem(name)
56
67
  Bridgetown::Utils::RequireGems.require_with_graceful_fail(name)
57
68
  plugins = Bridgetown::PluginManager.install_npm_dependencies(name:)
@@ -4,24 +4,24 @@ title: Posts
4
4
  ---
5
5
 
6
6
  <ul>
7
- <%- if options["templates"] == "erb" -%>
8
- <%% collections.posts.resources.each do |post| %>
7
+ <%- if options["templates"] == "liquid" -%>
8
+ {% for post in collections.posts.resources %}
9
9
  <li>
10
- <a href="<%%= post.relative_url %>"><%%= post.data.title %></a>
10
+ <a href="{{ post.relative_url }}">{{ post.data.title }}</a>
11
11
  </li>
12
- <%% end %>
12
+ {% endfor %}
13
13
  <%- elsif options["templates"] == "serbea" -%>
14
- {% collections.posts.resources.each do |post| %}
14
+ {% collections.posts.each do |post| %}
15
15
  <li>
16
16
  <a href="{{ post.relative_url }}">{{ post.data.title }}</a>
17
17
  </li>
18
18
  {% end %}
19
19
  <%- else -%>
20
- {% for post in collections.posts.resources %}
20
+ <%% collections.posts.each do |post| %>
21
21
  <li>
22
- <a href="{{ post.relative_url }}">{{ post.data.title }}</a>
22
+ <a href="<%%= post.relative_url %>"><%%= post.data.title %></a>
23
23
  </li>
24
- {% endfor %}
24
+ <%% end %>
25
25
  <%- end -%>
26
26
  </ul>
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta1
4
+ version: 2.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-02 00:00:00.000000000 Z
11
+ date: 2024-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 2.0.0.beta1
67
+ version: 2.0.0.beta2
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - '='
73
73
  - !ruby/object:Gem::Version
74
- version: 2.0.0.beta1
74
+ version: 2.0.0.beta2
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: csv
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -574,7 +574,6 @@ files:
574
574
  - lib/bridgetown-core/utils/require_gems.rb
575
575
  - lib/bridgetown-core/utils/ruby_exec.rb
576
576
  - lib/bridgetown-core/utils/smarty_pants_converter.rb
577
- - lib/bridgetown-core/version.rb
578
577
  - lib/bridgetown-core/watcher.rb
579
578
  - lib/bridgetown-core/yaml_parser.rb
580
579
  - lib/roda/plugins/bridgetown_server.rb
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bridgetown
4
- VERSION = "2.0.0.beta1"
5
- CODE_NAME = "(TBD!)"
6
- end