bridgetown-core 2.0.0.beta1 → 2.0.0.beta3
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/.rubocop.yml +3 -0
- data/Rakefile +2 -1
- data/bridgetown-core.gemspec +2 -2
- data/lib/bridgetown-core/cache.rb +3 -19
- data/lib/bridgetown-core/cleaner.rb +17 -19
- data/lib/bridgetown-core/collection.rb +9 -2
- data/lib/bridgetown-core/commands/build.rb +6 -17
- data/lib/bridgetown-core/commands/concerns/actions.rb +4 -0
- data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +7 -6
- data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +14 -13
- data/lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb +1 -1
- data/lib/bridgetown-core/commands/esbuild/update.rb +17 -3
- data/lib/bridgetown-core/commands/esbuild.rb +1 -1
- data/lib/bridgetown-core/component.rb +1 -1
- data/lib/bridgetown-core/concerns/layout_placeable.rb +1 -1
- data/lib/bridgetown-core/concerns/publishable.rb +2 -0
- data/lib/bridgetown-core/concerns/site/content.rb +4 -1
- data/lib/bridgetown-core/concerns/site/extensible.rb +6 -1
- data/lib/bridgetown-core/concerns/site/fast_refreshable.rb +20 -13
- data/lib/bridgetown-core/concerns/site/localizable.rb +2 -0
- data/lib/bridgetown-core/concerns/site/processable.rb +2 -0
- data/lib/bridgetown-core/concerns/site/renderable.rb +3 -0
- data/lib/bridgetown-core/concerns/site/ssr.rb +0 -1
- data/lib/bridgetown-core/configuration.rb +8 -14
- data/lib/bridgetown-core/converter.rb +2 -7
- data/lib/bridgetown-core/converters/identity.rb +3 -11
- data/lib/bridgetown-core/converters/liquid_templates.rb +3 -5
- data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/bridgetown-core/converters/markdown.rb +11 -14
- data/lib/bridgetown-core/converters/serbea_templates.rb +3 -4
- data/lib/bridgetown-core/drops/drop.rb +29 -42
- data/lib/bridgetown-core/drops/resource_drop.rb +3 -12
- data/lib/bridgetown-core/errors.rb +2 -8
- data/lib/bridgetown-core/filters/condition_helpers.rb +6 -9
- data/lib/bridgetown-core/filters/date_filters.rb +22 -35
- data/lib/bridgetown-core/filters/grouping_filters.rb +11 -11
- data/lib/bridgetown-core/filters.rb +53 -72
- data/lib/bridgetown-core/front_matter/defaults.rb +8 -13
- data/lib/bridgetown-core/generated_page.rb +6 -6
- data/lib/bridgetown-core/generators/prototype_generator.rb +0 -2
- data/lib/bridgetown-core/hooks.rb +0 -1
- data/lib/bridgetown-core/layout.rb +3 -4
- data/lib/bridgetown-core/liquid_extensions.rb +3 -5
- data/lib/bridgetown-core/log_adapter.rb +37 -56
- data/lib/bridgetown-core/plugin_manager.rb +18 -3
- data/lib/bridgetown-core/rack/logger.rb +0 -2
- data/lib/bridgetown-core/resource/base.rb +8 -8
- data/lib/bridgetown-core/resource/permalink_processor.rb +1 -1
- data/lib/bridgetown-core/ruby_template_view.rb +0 -1
- data/lib/bridgetown-core/static_file.rb +15 -20
- data/lib/bridgetown-core/tags/class_map.rb +1 -1
- data/lib/bridgetown-core/tags/post_url.rb +2 -32
- data/lib/bridgetown-core/utils/require_gems.rb +1 -3
- data/lib/bridgetown-core/utils.rb +41 -44
- data/lib/bridgetown-core/watcher.rb +2 -3
- data/lib/bridgetown-core.rb +1 -2
- data/lib/roda/plugins/bridgetown_server.rb +2 -3
- data/lib/site_template/package.json.erb +1 -0
- data/lib/site_template/postcss.config.js.erb +1 -1
- data/lib/site_template/src/posts.md.erb +8 -8
- metadata +6 -7
- data/lib/bridgetown-core/version.rb +0 -6
@@ -106,11 +106,7 @@ module Bridgetown
|
|
106
106
|
#
|
107
107
|
# @param new_data [HashWithDotAccess::Hash]
|
108
108
|
def data=(new_data)
|
109
|
-
if site.config.fast_refresh && write?
|
110
|
-
# TODO: investigate if this would be better:
|
111
|
-
# @data.value = front_matter_defaults
|
112
|
-
mark_for_fast_refresh!
|
113
|
-
end
|
109
|
+
mark_for_fast_refresh! if site.config.fast_refresh && write?
|
114
110
|
|
115
111
|
Signalize.batch do
|
116
112
|
@content_signal.value += 1
|
@@ -221,12 +217,12 @@ module Bridgetown
|
|
221
217
|
|
222
218
|
# @return [String]
|
223
219
|
def absolute_url
|
224
|
-
format_url
|
220
|
+
@absolute_url ||= format_url(destination&.absolute_url)
|
225
221
|
end
|
226
222
|
|
227
223
|
# @return [String]
|
228
224
|
def relative_url
|
229
|
-
format_url
|
225
|
+
@relative_url ||= format_url(destination&.relative_url)
|
230
226
|
end
|
231
227
|
|
232
228
|
# @return [String]
|
@@ -365,7 +361,11 @@ module Bridgetown
|
|
365
361
|
past_values = @data.peek.select do |key|
|
366
362
|
key == "categories" || key == "tags" || site.taxonomy_types.keys.any?(key)
|
367
363
|
end
|
368
|
-
|
364
|
+
origin_data = model.origin.read
|
365
|
+
correct_locale = origin_data["locale"] || origin_data[:locale] || data.locale
|
366
|
+
model.attributes = origin_data
|
367
|
+
model.attributes.locale = correct_locale
|
368
|
+
@relative_url = @absolute_url = nil # wipe memoizations
|
369
369
|
read!
|
370
370
|
tax_diff = past_values.any? { |k, v| @data.peek[k] != v }
|
371
371
|
|
@@ -120,7 +120,7 @@ module Bridgetown
|
|
120
120
|
end
|
121
121
|
|
122
122
|
# @param resource [Bridgetown::Resource::Base]
|
123
|
-
register_placeholder :name, ->(resource) do
|
123
|
+
register_placeholder :name, ->(resource) do # rubocop:disable Style/SymbolProc
|
124
124
|
resource.basename_without_ext
|
125
125
|
end
|
126
126
|
|
@@ -131,7 +131,6 @@ module Bridgetown
|
|
131
131
|
def _partial_path(partial_name, ext)
|
132
132
|
partial_name = partial_name.split("/").tap { _1.last.prepend("_") }.join("/")
|
133
133
|
|
134
|
-
# TODO: see if there's a workaround for this to speed up performance
|
135
134
|
site.in_source_dir(site.config[:partials_dir], "#{partial_name}.#{ext}")
|
136
135
|
end
|
137
136
|
end
|
@@ -48,11 +48,10 @@ module Bridgetown
|
|
48
48
|
@path ||= File.join(*[@base, @dir, @name].compact)
|
49
49
|
end
|
50
50
|
|
51
|
-
# Obtain destination path
|
51
|
+
# Obtain destination path
|
52
52
|
#
|
53
|
-
# dest
|
54
|
-
#
|
55
|
-
# Returns destination file path.
|
53
|
+
# @param dest [String] path to the destination dir
|
54
|
+
# @return [String]
|
56
55
|
def destination(dest)
|
57
56
|
dest = site.in_dest_dir(dest)
|
58
57
|
dest_url = url
|
@@ -76,22 +75,21 @@ module Bridgetown
|
|
76
75
|
|
77
76
|
alias_method :date, :modified_time
|
78
77
|
|
79
|
-
#
|
78
|
+
# @return [Integer] last modification time for this file
|
80
79
|
def mtime
|
81
80
|
modified_time.to_i
|
82
81
|
end
|
83
82
|
|
84
83
|
# Is source path modified?
|
85
84
|
#
|
86
|
-
#
|
85
|
+
# @return [Boolean] true if modified since last write
|
87
86
|
def modified?
|
88
87
|
self.class.mtimes[path] != mtime
|
89
88
|
end
|
90
89
|
|
91
90
|
# Whether to write the file to the filesystem
|
92
91
|
#
|
93
|
-
#
|
94
|
-
# bridgetown.config.yml contain `published: false`.
|
92
|
+
# @return [Boolean] true unless the defaults for the destination path contain `published: false`
|
95
93
|
def write?
|
96
94
|
publishable = defaults.fetch("published", true)
|
97
95
|
return publishable unless @collection
|
@@ -99,11 +97,10 @@ module Bridgetown
|
|
99
97
|
publishable && @collection.write?
|
100
98
|
end
|
101
99
|
|
102
|
-
# Write the static file to the destination directory (if modified)
|
103
|
-
#
|
104
|
-
# dest - The String path to the destination dir.
|
100
|
+
# Write the static file to the destination directory (if modified)
|
105
101
|
#
|
106
|
-
#
|
102
|
+
# @param dest [String] path to the destination dir
|
103
|
+
# @return [Boolean] false if the file was not modified since last time (no-op)
|
107
104
|
def write(dest)
|
108
105
|
dest_path = destination(dest)
|
109
106
|
return false if File.exist?(dest_path) && !modified?
|
@@ -152,12 +149,12 @@ module Bridgetown
|
|
152
149
|
#
|
153
150
|
# NOTE: `String#gsub!` removes all trailing periods (in comparison to `String#chomp!`)
|
154
151
|
#
|
155
|
-
#
|
152
|
+
# @example
|
156
153
|
# When `relative_path` is "_methods/site/my-cool-avatar...png":
|
157
154
|
# cleaned_relative_path
|
158
155
|
# # => "/site/my-cool-avatar"
|
159
156
|
#
|
160
|
-
#
|
157
|
+
# @return [String] cleaned relative path of the static file
|
161
158
|
def cleaned_relative_path
|
162
159
|
@cleaned_relative_path ||= begin
|
163
160
|
cleaned = relative_path[0..-extname.length - 1]
|
@@ -169,7 +166,7 @@ module Bridgetown
|
|
169
166
|
|
170
167
|
# Applies a similar URL-building technique as resources that takes
|
171
168
|
# the collection's URL template into account. The default URL template can
|
172
|
-
# be overriden in the collection's configuration
|
169
|
+
# be overriden in the collection's configuration
|
173
170
|
def url
|
174
171
|
@url ||= begin
|
175
172
|
newly_processed = false
|
@@ -183,19 +180,17 @@ module Bridgetown
|
|
183
180
|
end
|
184
181
|
end
|
185
182
|
|
186
|
-
#
|
183
|
+
# @return [Symbol, nil] type of the collection if present
|
187
184
|
def type
|
188
185
|
@type ||= @collection&.label&.to_sym
|
189
186
|
end
|
190
187
|
|
191
|
-
#
|
192
|
-
# as defined in bridgetown.config.yml.
|
188
|
+
# @return [Hash] front matter defaults defined for the file's URL and/or type
|
193
189
|
def defaults
|
194
190
|
@defaults ||= site.frontmatter_defaults.all url, type
|
195
191
|
end
|
196
192
|
|
197
|
-
#
|
198
|
-
# Includes only the relative path of the object.
|
193
|
+
# @return [String] includes only the relative path of the object
|
199
194
|
def inspect
|
200
195
|
"#<#{self.class} @relative_path=#{relative_path.inspect}>"
|
201
196
|
end
|
@@ -23,7 +23,7 @@ module Bridgetown
|
|
23
23
|
class ClassMap < Liquid::Tag
|
24
24
|
# @see https://api.rubyonrails.org/classes/ActiveModel/Type/Boolean.html
|
25
25
|
FALSE_VALUES = [
|
26
|
-
nil, "nil", "NIL",
|
26
|
+
nil, "nil", "NIL", 0, "0", :"0", "f", :f, "F", :F, "false",
|
27
27
|
false, "FALSE", :FALSE,
|
28
28
|
].to_set.freeze
|
29
29
|
|
@@ -12,7 +12,7 @@ module Bridgetown
|
|
12
12
|
|
13
13
|
all, @path, @date, @slug = *name.sub(%r!^/!, "").match(MATCHER)
|
14
14
|
unless all
|
15
|
-
raise Bridgetown::Errors::
|
15
|
+
raise Bridgetown::Errors::FatalException,
|
16
16
|
"'#{name}' does not contain valid date and/or title."
|
17
17
|
end
|
18
18
|
|
@@ -31,24 +31,6 @@ module Bridgetown
|
|
31
31
|
def ==(other)
|
32
32
|
other.relative_path.to_s.match(@name_regex)
|
33
33
|
end
|
34
|
-
|
35
|
-
def deprecated_equality(other)
|
36
|
-
slug == post_slug(other) &&
|
37
|
-
post_date.year == other.date.year &&
|
38
|
-
post_date.month == other.date.month &&
|
39
|
-
post_date.day == other.date.day
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
# Construct the directory-aware post slug for a Bridgetown::Post
|
45
|
-
#
|
46
|
-
# other - the Bridgetown::Post
|
47
|
-
#
|
48
|
-
# Returns the post slug with the subdirectory (relative to _posts)
|
49
|
-
def post_slug(other)
|
50
|
-
other.data.slug
|
51
|
-
end
|
52
34
|
end
|
53
35
|
|
54
36
|
class PostUrl < Liquid::Tag
|
@@ -75,19 +57,7 @@ module Bridgetown
|
|
75
57
|
site.collections.posts.resources.each do |document|
|
76
58
|
return relative_url(document) if @post == document
|
77
59
|
|
78
|
-
|
79
|
-
# with deprecation warning if this matches
|
80
|
-
next unless @post.deprecated_equality document
|
81
|
-
|
82
|
-
Bridgetown::Deprecator.deprecation_message(
|
83
|
-
"A call to " \
|
84
|
-
"'{% post_url #{@post.name} %}' did not match " \
|
85
|
-
"a post using the new matching method of checking name " \
|
86
|
-
"(path-date-slug) equality. Please make sure that you " \
|
87
|
-
"change this tag to match the post's name exactly."
|
88
|
-
)
|
89
|
-
|
90
|
-
return relative_url(document)
|
60
|
+
next
|
91
61
|
end
|
92
62
|
|
93
63
|
raise Bridgetown::Errors::PostURLError, <<~MSG
|
@@ -4,13 +4,11 @@ module Bridgetown
|
|
4
4
|
module Utils
|
5
5
|
module RequireGems
|
6
6
|
class << self
|
7
|
-
#
|
8
7
|
# Require a gem or gems. If it's not present, show a very nice error
|
9
8
|
# message that explains everything and is much more helpful than the
|
10
9
|
# normal LoadError.
|
11
10
|
#
|
12
|
-
# names
|
13
|
-
#
|
11
|
+
# @param names [String, Array<String>] gem name or array of gem names
|
14
12
|
def require_with_graceful_fail(names)
|
15
13
|
Array(names).each do |name|
|
16
14
|
Bridgetown.logger.debug "Requiring:", name.to_s
|
@@ -49,15 +49,12 @@ module Bridgetown
|
|
49
49
|
deep_merge_hashes!(master_hash.dup, other_hash)
|
50
50
|
end
|
51
51
|
|
52
|
-
# Merges a master hash with another hash, recursively.
|
52
|
+
# Merges a master hash with another hash, recursively. This code was lovingly stolen from
|
53
|
+
# some random gem: https://rubygems.org/gems/tartan Thanks to whoever made it.
|
53
54
|
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
# This code was lovingly stolen from some random gem:
|
58
|
-
# http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
|
59
|
-
#
|
60
|
-
# Thanks to whoever made it.
|
55
|
+
# @param target [Hash] the "parent" hash whose values will be overridden
|
56
|
+
# @param overwrite [Hash] the other hash whose values will be persisted after the merge
|
57
|
+
# @return [Hash]
|
61
58
|
def deep_merge_hashes!(target, overwrite)
|
62
59
|
merge_values(target, overwrite)
|
63
60
|
merge_default_proc(target, overwrite)
|
@@ -110,11 +107,9 @@ module Bridgetown
|
|
110
107
|
|
111
108
|
# Parse a date/time and throw an error if invalid
|
112
109
|
#
|
113
|
-
# input
|
114
|
-
# msg
|
115
|
-
#
|
116
|
-
# Returns the parsed date if successful, throws a FatalException
|
117
|
-
# if not
|
110
|
+
# @param input [String] the date/time to parse
|
111
|
+
# @param msg [String] the error message to show the user
|
112
|
+
# @return [Time] the parsed date if successful, throws a FatalException if not
|
118
113
|
def parse_date(input, msg = "Input could not be parsed.")
|
119
114
|
Time.parse(input).localtime
|
120
115
|
rescue ArgumentError
|
@@ -140,35 +135,30 @@ module Bridgetown
|
|
140
135
|
FrontMatter::Loaders::Ruby.header?(file)
|
141
136
|
end
|
142
137
|
|
143
|
-
# Slugify a filename or title
|
138
|
+
# Slugify a filename or title
|
144
139
|
#
|
145
|
-
#
|
146
|
-
# mode - how string is slugified
|
147
|
-
# cased - whether to replace all uppercase letters with their
|
148
|
-
# lowercase counterparts
|
140
|
+
# When mode is `none`, return the given string.
|
149
141
|
#
|
150
|
-
# When mode is
|
151
|
-
#
|
152
|
-
# When mode is "raw", return the given string,
|
142
|
+
# When mode is `raw`, return the given string,
|
153
143
|
# with every sequence of spaces characters replaced with a hyphen.
|
154
144
|
#
|
155
|
-
# When mode is
|
145
|
+
# When mode is `default`, `simple`, or `nil`, non-alphabetic characters are
|
156
146
|
# replaced with a hyphen too.
|
157
147
|
#
|
158
|
-
# When mode is
|
148
|
+
# When mode is `pretty`, some non-alphabetic characters (`._~!$&'()+,;=@`)
|
159
149
|
# are not replaced with hyphen.
|
160
150
|
#
|
161
|
-
# When mode is
|
162
|
-
# a-z (lowercase), A-Z (uppercase) and 0-9 (numbers) are not replaced with hyphen.
|
151
|
+
# When mode is `ascii`, some everything else except ASCII characters
|
152
|
+
# `a-z` (lowercase), `A-Z` (uppercase) and `0-9` (numbers) are not replaced with hyphen.
|
163
153
|
#
|
164
|
-
# When mode is
|
154
|
+
# When mode is `latin`, the input string is first preprocessed so that
|
165
155
|
# any letters with accents are replaced with the plain letter. Afterwards,
|
166
|
-
# it follows the
|
156
|
+
# it follows the `default` mode of operation.
|
167
157
|
#
|
168
|
-
# If cased is true
|
158
|
+
# If `cased` is `true`, all uppercase letters in the result string are
|
169
159
|
# replaced with their lowercase counterparts.
|
170
160
|
#
|
171
|
-
#
|
161
|
+
# @example
|
172
162
|
# slugify("The _config.yml file")
|
173
163
|
# # => "the-config-yml-file"
|
174
164
|
#
|
@@ -184,7 +174,11 @@ module Bridgetown
|
|
184
174
|
# slugify("The _config.yml file", "latin")
|
185
175
|
# # => "the-config-yml-file"
|
186
176
|
#
|
187
|
-
#
|
177
|
+
# @param string [String] filename or title to slugify
|
178
|
+
# @param mode [String] how string is slugified
|
179
|
+
# @param cased [Boolean] whether to replace all uppercase letters with their
|
180
|
+
# lowercase counterparts
|
181
|
+
# @return [String] the slugified string.
|
188
182
|
def slugify(string, mode: nil, cased: false)
|
189
183
|
mode ||= "default"
|
190
184
|
return nil if string.nil?
|
@@ -210,13 +204,13 @@ module Bridgetown
|
|
210
204
|
end
|
211
205
|
|
212
206
|
# Work the same way as Dir.glob but seperating the input into two parts
|
213
|
-
# ('dir' + '/' + 'pattern') to make sure the first part('dir') does not act
|
207
|
+
# (`'dir' + '/' + 'pattern'`) to make sure the first part(`'dir'`) does not act
|
214
208
|
# as a pattern.
|
215
209
|
#
|
216
|
-
# For example, Dir.glob("path[/*") always returns an empty array,
|
217
|
-
# because the method fails to find the closing pattern to
|
210
|
+
# For example, `Dir.glob("path[/*")` always returns an empty array,
|
211
|
+
# because the method fails to find the closing pattern to `[` which is `]`
|
218
212
|
#
|
219
|
-
#
|
213
|
+
# @example
|
220
214
|
# safe_glob("path[", "*")
|
221
215
|
# # => ["path[/file1", "path[/file2"]
|
222
216
|
#
|
@@ -226,12 +220,13 @@ module Bridgetown
|
|
226
220
|
# safe_glob("path", ["**", "*"])
|
227
221
|
# # => ["path[/file1", "path[/folder/file2"]
|
228
222
|
#
|
229
|
-
# dir
|
230
|
-
#
|
231
|
-
# patterns
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
223
|
+
# @param dir [String] the dir where glob will be executed under
|
224
|
+
# (the dir will be included to each result)
|
225
|
+
# @param patterns [String, Array<String>] the patterns (or the pattern) which will be applied
|
226
|
+
# under the dir
|
227
|
+
# @param flags [Integer] the flags which will be applied to the pattern,
|
228
|
+
# a bitwise OR of the `File::FNM_XXX` constants
|
229
|
+
# @return [Array<String>] matched pathes
|
235
230
|
def safe_glob(dir, patterns, flags = 0)
|
236
231
|
return [] unless Dir.exist?(dir)
|
237
232
|
|
@@ -243,8 +238,8 @@ module Bridgetown
|
|
243
238
|
end
|
244
239
|
end
|
245
240
|
|
246
|
-
#
|
247
|
-
#
|
241
|
+
# @return [Hash] merged option hash for `File.read` of `site` (if exists)
|
242
|
+
# and a given param
|
248
243
|
def merged_file_read_opts(site, opts)
|
249
244
|
merged = (site ? site.file_read_opts : {}).merge(opts)
|
250
245
|
if merged[:encoding] && !merged[:encoding].start_with?("bom|")
|
@@ -256,8 +251,10 @@ module Bridgetown
|
|
256
251
|
merged
|
257
252
|
end
|
258
253
|
|
259
|
-
#
|
260
|
-
#
|
254
|
+
# Provides a string that's been reindented so that Markdown's four+ spaces =
|
255
|
+
# code doesn't get triggered for nested components
|
256
|
+
# @param input [String]
|
257
|
+
# @return [String]
|
261
258
|
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
|
262
259
|
def reindent_for_markdown(input)
|
263
260
|
lines = input.lines
|
@@ -159,9 +159,8 @@ module Bridgetown
|
|
159
159
|
|
160
160
|
# Paths to ignore for the watch option
|
161
161
|
#
|
162
|
-
# options
|
163
|
-
#
|
164
|
-
# Returns a list of relative paths from source that should be ignored
|
162
|
+
# @param options [Bridgetown::Configuration] options loaded from config and/or CLI
|
163
|
+
# @return [Array<String>] list of relative paths from source that should be ignored
|
165
164
|
def listen_ignore_paths(options)
|
166
165
|
source = Pathname.new(options["source"]).expand_path
|
167
166
|
paths = to_exclude(options)
|
data/lib/bridgetown-core.rb
CHANGED
@@ -35,7 +35,7 @@ require "yaml"
|
|
35
35
|
require "bridgetown-foundation"
|
36
36
|
|
37
37
|
# 3rd party
|
38
|
-
require "active_support" # TODO: remove by the end of
|
38
|
+
require "active_support" # TODO: remove by the end of 2025
|
39
39
|
require "active_support/core_ext/object/blank"
|
40
40
|
require "active_support/core_ext/string/inflections"
|
41
41
|
require "active_support/core_ext/string/output_safety"
|
@@ -76,7 +76,6 @@ module Bridgetown
|
|
76
76
|
autoload :DefaultsReader, "bridgetown-core/readers/defaults_reader"
|
77
77
|
autoload :Deprecator, "bridgetown-core/deprecator"
|
78
78
|
autoload :EntryFilter, "bridgetown-core/entry_filter"
|
79
|
-
# TODO: we have too many errors! This is silly
|
80
79
|
autoload :Errors, "bridgetown-core/errors"
|
81
80
|
autoload :FrontMatter, "bridgetown-core/front_matter"
|
82
81
|
autoload :GeneratedPage, "bridgetown-core/generated_page"
|
@@ -158,17 +158,16 @@ class Roda
|
|
158
158
|
scope.initialize_bridgetown_context
|
159
159
|
scope.initialize_bridgetown_root
|
160
160
|
|
161
|
-
# Run the static file server
|
162
|
-
ssg
|
163
|
-
|
164
161
|
# There are two different code paths depending on if there's a site `base_path` configured
|
165
162
|
if Bridgetown::Current.preloaded_configuration.base_path == "/"
|
163
|
+
ssg # static file server
|
166
164
|
Bridgetown::Rack::Routes.load_all scope
|
167
165
|
return
|
168
166
|
end
|
169
167
|
|
170
168
|
# Support custom base_path configurations
|
171
169
|
on(Bridgetown::Current.preloaded_configuration.base_path.delete_prefix("/")) do
|
170
|
+
ssg # static file server
|
172
171
|
Bridgetown::Rack::Routes.load_all scope
|
173
172
|
end
|
174
173
|
|
@@ -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.beta3
|
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-
|
11
|
+
date: 2024-11-16 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.beta3
|
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.beta3
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: csv
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -328,14 +328,14 @@ dependencies:
|
|
328
328
|
requirements:
|
329
329
|
- - ">="
|
330
330
|
- !ruby/object:Gem::Version
|
331
|
-
version: 0.
|
331
|
+
version: 0.6.0
|
332
332
|
type: :runtime
|
333
333
|
prerelease: false
|
334
334
|
version_requirements: !ruby/object:Gem::Requirement
|
335
335
|
requirements:
|
336
336
|
- - ">="
|
337
337
|
- !ruby/object:Gem::Version
|
338
|
-
version: 0.
|
338
|
+
version: 0.6.0
|
339
339
|
- !ruby/object:Gem::Dependency
|
340
340
|
name: thor
|
341
341
|
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
|