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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/Rakefile +2 -1
  4. data/bridgetown-core.gemspec +2 -2
  5. data/lib/bridgetown-core/cache.rb +3 -19
  6. data/lib/bridgetown-core/cleaner.rb +17 -19
  7. data/lib/bridgetown-core/collection.rb +9 -2
  8. data/lib/bridgetown-core/commands/build.rb +6 -17
  9. data/lib/bridgetown-core/commands/concerns/actions.rb +4 -0
  10. data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +7 -6
  11. data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +14 -13
  12. data/lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb +1 -1
  13. data/lib/bridgetown-core/commands/esbuild/update.rb +17 -3
  14. data/lib/bridgetown-core/commands/esbuild.rb +1 -1
  15. data/lib/bridgetown-core/component.rb +1 -1
  16. data/lib/bridgetown-core/concerns/layout_placeable.rb +1 -1
  17. data/lib/bridgetown-core/concerns/publishable.rb +2 -0
  18. data/lib/bridgetown-core/concerns/site/content.rb +4 -1
  19. data/lib/bridgetown-core/concerns/site/extensible.rb +6 -1
  20. data/lib/bridgetown-core/concerns/site/fast_refreshable.rb +20 -13
  21. data/lib/bridgetown-core/concerns/site/localizable.rb +2 -0
  22. data/lib/bridgetown-core/concerns/site/processable.rb +2 -0
  23. data/lib/bridgetown-core/concerns/site/renderable.rb +3 -0
  24. data/lib/bridgetown-core/concerns/site/ssr.rb +0 -1
  25. data/lib/bridgetown-core/configuration.rb +8 -14
  26. data/lib/bridgetown-core/converter.rb +2 -7
  27. data/lib/bridgetown-core/converters/identity.rb +3 -11
  28. data/lib/bridgetown-core/converters/liquid_templates.rb +3 -5
  29. data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
  30. data/lib/bridgetown-core/converters/markdown.rb +11 -14
  31. data/lib/bridgetown-core/converters/serbea_templates.rb +3 -4
  32. data/lib/bridgetown-core/drops/drop.rb +29 -42
  33. data/lib/bridgetown-core/drops/resource_drop.rb +3 -12
  34. data/lib/bridgetown-core/errors.rb +2 -8
  35. data/lib/bridgetown-core/filters/condition_helpers.rb +6 -9
  36. data/lib/bridgetown-core/filters/date_filters.rb +22 -35
  37. data/lib/bridgetown-core/filters/grouping_filters.rb +11 -11
  38. data/lib/bridgetown-core/filters.rb +53 -72
  39. data/lib/bridgetown-core/front_matter/defaults.rb +8 -13
  40. data/lib/bridgetown-core/generated_page.rb +6 -6
  41. data/lib/bridgetown-core/generators/prototype_generator.rb +0 -2
  42. data/lib/bridgetown-core/hooks.rb +0 -1
  43. data/lib/bridgetown-core/layout.rb +3 -4
  44. data/lib/bridgetown-core/liquid_extensions.rb +3 -5
  45. data/lib/bridgetown-core/log_adapter.rb +37 -56
  46. data/lib/bridgetown-core/plugin_manager.rb +18 -3
  47. data/lib/bridgetown-core/rack/logger.rb +0 -2
  48. data/lib/bridgetown-core/resource/base.rb +8 -8
  49. data/lib/bridgetown-core/resource/permalink_processor.rb +1 -1
  50. data/lib/bridgetown-core/ruby_template_view.rb +0 -1
  51. data/lib/bridgetown-core/static_file.rb +15 -20
  52. data/lib/bridgetown-core/tags/class_map.rb +1 -1
  53. data/lib/bridgetown-core/tags/post_url.rb +2 -32
  54. data/lib/bridgetown-core/utils/require_gems.rb +1 -3
  55. data/lib/bridgetown-core/utils.rb +41 -44
  56. data/lib/bridgetown-core/watcher.rb +2 -3
  57. data/lib/bridgetown-core.rb +1 -2
  58. data/lib/roda/plugins/bridgetown_server.rb +2 -3
  59. data/lib/site_template/package.json.erb +1 -0
  60. data/lib/site_template/postcss.config.js.erb +1 -1
  61. data/lib/site_template/src/posts.md.erb +8 -8
  62. metadata +6 -7
  63. 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 destination&.absolute_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 destination&.relative_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
- model.attributes = model.origin.read
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 - The String path to the destination dir.
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
- # Returns last modification time for this file.
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
- # Returns true if modified since last write.
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
- # Returns true unless the defaults for the destination path from
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
- # Returns false if the file was not modified since last time (no-op).
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
- # Examples:
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
- # Returns the cleaned relative path of the static file.
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 in bridgetown.config.yml.
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
- # Returns the type of the collection if present, nil otherwise.
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
- # Returns the front matter defaults defined for the file's URL and/or type
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
- # Returns a debug string on inspecting the static file.
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", false, 0, "0", :"0", "f", :f, "F", :F, "false",
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::InvalidPostNameError,
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
- # New matching method did not match, fall back to old method
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 - a string gem name or array of gem 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
- # master_hash - the "parent" hash whose values will be overridden
55
- # other_hash - the other hash whose values will be persisted after the merge
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 - the date/time to parse
114
- # msg - (optional) the error message to show the user
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
- # string - the filename or title to slugify
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 "none", return the given string.
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 "default", "simple", or nil, non-alphabetic characters are
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 "pretty", some non-alphabetic characters (._~!$&'()+,;=@)
148
+ # When mode is `pretty`, some non-alphabetic characters (`._~!$&'()+,;=@`)
159
149
  # are not replaced with hyphen.
160
150
  #
161
- # When mode is "ascii", some everything else except ASCII characters
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 "latin", the input string is first preprocessed so that
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 "default" mode of operation.
156
+ # it follows the `default` mode of operation.
167
157
  #
168
- # If cased is true, all uppercase letters in the result string are
158
+ # If `cased` is `true`, all uppercase letters in the result string are
169
159
  # replaced with their lowercase counterparts.
170
160
  #
171
- # Examples:
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
- # Returns the slugified string.
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 '[' which is ']'
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
- # Examples:
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 - the dir where glob will be executed under
230
- # (the dir will be included to each result)
231
- # patterns - the patterns (or the pattern) which will be applied under the dir
232
- # flags - the flags which will be applied to the pattern
233
- #
234
- # Returns matched pathes
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
- # Returns merged option hash for File.read of self.site (if exists)
247
- # and a given param
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
- # Returns a string that's been reindented so that Markdown's four+ spaces =
260
- # code doesn't get triggered for nested Liquid components
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 - A Hash of options passed to the command
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)
@@ -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 2024
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
 
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "<%= @site_name %>",
3
3
  "version": "1.0.0",
4
+ "type": "module",
4
5
  "private": true,
5
6
  "scripts": {
6
7
  "esbuild": "node esbuild.config.js --minify",
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  plugins: {
3
3
  'postcss-flexbugs-fixes': {},
4
4
  'postcss-preset-env': {
@@ -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.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-08-02 00:00:00.000000000 Z
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.beta1
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.beta1
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.5.2
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.5.2
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
@@ -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