bridgetown-core 2.0.0.beta1 → 2.0.0.beta2
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/Rakefile +2 -1
- data/bridgetown-core.gemspec +1 -1
- data/lib/bridgetown-core/collection.rb +8 -1
- data/lib/bridgetown-core/plugin_manager.rb +11 -0
- data/lib/site_template/src/posts.md.erb +8 -8
- metadata +4 -5
- data/lib/bridgetown-core/version.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad323d78c36221049d27482e186a24793c5e52b478e913b778ba0d8809658990
|
4
|
+
data.tar.gz: dfc80b46023d5f28e38f2116e62676f579d175f1fcca023c46bb921298c99dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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"
|
data/bridgetown-core.gemspec
CHANGED
@@ -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
|
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"] == "
|
8
|
-
|
7
|
+
<%- if options["templates"] == "liquid" -%>
|
8
|
+
{% for post in collections.posts.resources %}
|
9
9
|
<li>
|
10
|
-
<a href="
|
10
|
+
<a href="{{ post.relative_url }}">{{ post.data.title }}</a>
|
11
11
|
</li>
|
12
|
-
|
12
|
+
{% endfor %}
|
13
13
|
<%- elsif options["templates"] == "serbea" -%>
|
14
|
-
{% collections.posts.
|
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
|
-
|
20
|
+
<%% collections.posts.each do |post| %>
|
21
21
|
<li>
|
22
|
-
<a href="
|
22
|
+
<a href="<%%= post.relative_url %>"><%%= post.data.title %></a>
|
23
23
|
</li>
|
24
|
-
|
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.
|
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-
|
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.
|
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.
|
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
|