bridgetown-core 1.0.0 → 1.1.0.beta1

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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/lib/bridgetown-core/collection.rb +37 -20
  4. data/lib/bridgetown-core/commands/concerns/actions.rb +3 -2
  5. data/lib/bridgetown-core/commands/configure.rb +1 -1
  6. data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +95 -12
  7. data/lib/bridgetown-core/commands/new.rb +10 -9
  8. data/lib/bridgetown-core/commands/plugins.rb +2 -0
  9. data/lib/bridgetown-core/commands/start.rb +3 -0
  10. data/lib/bridgetown-core/commands/webpack/update.rb +2 -2
  11. data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +11 -2
  12. data/lib/bridgetown-core/component.rb +13 -7
  13. data/lib/bridgetown-core/concerns/localizable.rb +20 -0
  14. data/lib/bridgetown-core/concerns/prioritizable.rb +44 -0
  15. data/lib/bridgetown-core/concerns/publishable.rb +11 -1
  16. data/lib/bridgetown-core/concerns/site/configurable.rb +2 -10
  17. data/lib/bridgetown-core/concerns/site/localizable.rb +5 -1
  18. data/lib/bridgetown-core/concerns/site/ssr.rb +3 -3
  19. data/lib/bridgetown-core/concerns/site/writable.rb +28 -0
  20. data/lib/bridgetown-core/configuration.rb +2 -0
  21. data/lib/bridgetown-core/configurations/bt-postcss/postcss.config.js +5 -3
  22. data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -1
  23. data/lib/bridgetown-core/configurations/lit/esbuild-plugins.js +21 -0
  24. data/lib/bridgetown-core/configurations/lit/happy-days.lit.js +26 -0
  25. data/lib/bridgetown-core/configurations/lit/lit-components-entry.js +1 -0
  26. data/lib/bridgetown-core/configurations/lit/lit-ssr.config.js +6 -0
  27. data/lib/bridgetown-core/configurations/lit.rb +95 -0
  28. data/lib/bridgetown-core/configurations/open-props/variables.css.erb +11 -0
  29. data/lib/bridgetown-core/configurations/open-props.rb +21 -0
  30. data/lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb +9 -0
  31. data/lib/bridgetown-core/configurations/ruby2js.rb +67 -0
  32. data/lib/bridgetown-core/configurations/shoelace.rb +50 -0
  33. data/lib/bridgetown-core/configurations/tailwindcss.rb +16 -2
  34. data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
  35. data/lib/bridgetown-core/drops/generated_page_drop.rb +2 -1
  36. data/lib/bridgetown-core/drops/resource_drop.rb +2 -1
  37. data/lib/bridgetown-core/errors.rb +5 -5
  38. data/lib/bridgetown-core/filters/translation_filters.rb +11 -0
  39. data/lib/bridgetown-core/filters/url_filters.rb +37 -10
  40. data/lib/bridgetown-core/filters.rb +3 -0
  41. data/lib/bridgetown-core/frontmatter_defaults.rb +14 -8
  42. data/lib/bridgetown-core/generated_page.rb +1 -0
  43. data/lib/bridgetown-core/kramdown/parser/gfm.rb +36 -0
  44. data/lib/bridgetown-core/model/base.rb +1 -2
  45. data/lib/bridgetown-core/plugin.rb +6 -37
  46. data/lib/bridgetown-core/plugin_manager.rb +3 -2
  47. data/lib/bridgetown-core/rack/boot.rb +5 -0
  48. data/lib/bridgetown-core/rack/logger.rb +14 -4
  49. data/lib/bridgetown-core/rack/roda.rb +102 -8
  50. data/lib/bridgetown-core/rack/routes.rb +67 -2
  51. data/lib/bridgetown-core/resource/base.rb +4 -6
  52. data/lib/bridgetown-core/resource/destination.rb +18 -0
  53. data/lib/bridgetown-core/resource/permalink_processor.rb +6 -4
  54. data/lib/bridgetown-core/resource/relations.rb +1 -1
  55. data/lib/bridgetown-core/utils/aux.rb +2 -1
  56. data/lib/bridgetown-core/utils/require_gems.rb +3 -6
  57. data/lib/bridgetown-core/utils.rb +24 -11
  58. data/lib/bridgetown-core/version.rb +2 -2
  59. data/lib/bridgetown-core/watcher.rb +19 -6
  60. data/lib/bridgetown-core.rb +8 -2
  61. data/lib/site_template/README.md +2 -2
  62. data/lib/site_template/bridgetown.config.yml +3 -0
  63. data/lib/site_template/frontend/javascript/index.js.erb +1 -0
  64. data/lib/site_template/frontend/styles/syntax-highlighting.css +77 -0
  65. data/lib/site_template/package.json.erb +18 -17
  66. data/lib/site_template/server/roda_app.rb +3 -6
  67. data/lib/site_template/src/404.html +2 -1
  68. data/lib/site_template/src/500.html +10 -0
  69. metadata +20 -5
  70. data/lib/bridgetown-core/publisher.rb +0 -29
@@ -320,7 +320,7 @@ module Bridgetown
320
320
  end
321
321
 
322
322
  if continue_processing
323
- line_indentation = line.match(%r!^ +!).yield_self do |indent|
323
+ line_indentation = line.match(%r!^ +!).then do |indent|
324
324
  indent.nil? ? "" : indent[0]
325
325
  end
326
326
  new_indentation = line_indentation.rjust(starting_indent_length, " ")
@@ -339,6 +339,11 @@ module Bridgetown
339
339
  end
340
340
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
341
341
 
342
+ # Return an asset path based on a frontend manifest file
343
+ #
344
+ # @param site [Bridgetown::Site] The current site object
345
+ # @param asset_type [String] js or css, or filename in manifest
346
+ # @return [String, nil]
342
347
  def parse_frontend_manifest_file(site, asset_type)
343
348
  case frontend_bundler_type(site.root_dir)
344
349
  when :webpack
@@ -362,9 +367,6 @@ module Bridgetown
362
367
  # file isnt found
363
368
  # @return [nil] Returns nil if the asset isnt found
364
369
  # @return [String] Returns the path to the asset if no issues parsing
365
- #
366
- # @raise [WebpackAssetError] if unable to find css or js in the manifest
367
- # file
368
370
  def parse_webpack_manifest_file(site, asset_type)
369
371
  return log_frontend_asset_error(site, "Webpack manifest") if site.frontend_manifest.nil?
370
372
 
@@ -389,16 +391,17 @@ module Bridgetown
389
391
  # file isnt found
390
392
  # @return [nil] Returns nil if the asset isnt found
391
393
  # @return [String] Returns the path to the asset if no issues parsing
392
- #
393
- # @raise [WebpackAssetError] if unable to find css or js in the manifest
394
- # file
395
394
  def parse_esbuild_manifest_file(site, asset_type) # rubocop:disable Metrics/PerceivedComplexity
396
395
  return log_frontend_asset_error(site, "esbuild manifest") if site.frontend_manifest.nil?
397
396
 
398
- asset_path = if %w(js css).include?(asset_type)
399
- folder = asset_type == "js" ? "javascript" : "styles"
400
- site.frontend_manifest["#{folder}/index.#{asset_type}"] ||
401
- site.frontend_manifest["#{folder}/index.#{asset_type}.rb"]
397
+ asset_path = case asset_type
398
+ when "css"
399
+ site.frontend_manifest["styles/index.css"] ||
400
+ site.frontend_manifest["styles/index.scss"] ||
401
+ site.frontend_manifest["styles/index.sass"]
402
+ when "js"
403
+ site.frontend_manifest["javascript/index.js"] ||
404
+ site.frontend_manifest["javascript/index.js.rb"]
402
405
  else
403
406
  site.frontend_manifest.find do |item, _|
404
407
  item.sub(%r{^../(frontend/|src/)?}, "") == asset_type
@@ -488,6 +491,16 @@ module Bridgetown
488
491
  %(<script type="module">#{code}</script>).html_safe
489
492
  end
490
493
 
494
+ def chomp_locale_suffix!(path, locale)
495
+ return path unless locale
496
+
497
+ if path.ends_with?(".#{locale}")
498
+ path.chomp!(".#{locale}")
499
+ elsif path.ends_with?(".multi")
500
+ path.chomp!(".multi")
501
+ end
502
+ end
503
+
491
504
  private
492
505
 
493
506
  def merge_values(target, overwrite)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bridgetown
4
- VERSION = "1.0.0"
5
- CODE_NAME = "Pearl"
4
+ VERSION = "1.1.0.beta1"
5
+ CODE_NAME = "Belmont"
6
6
  end
@@ -12,11 +12,21 @@ module Bridgetown
12
12
  #
13
13
  # @param site [Bridgetown::Site] the current site instance
14
14
  # @param options [Bridgetown::Configuration] the site configuration
15
- def watch(site, options)
15
+ # @yield the block will be called when in SSR mode right after the post_read event
16
+ def watch(site, options, &block)
16
17
  ENV["LISTEN_GEM_DEBUGGING"] ||= "1" if options["verbose"]
17
18
 
18
19
  listen(site, options)
19
20
 
21
+ if site.ssr?
22
+ # We need to trigger pre/post read hooks when SSR reload occurs in order to re-run Builders
23
+ Bridgetown::Hooks.register_one :site, :after_soft_reset, reloadable: false do
24
+ Bridgetown::Hooks.trigger :site, :pre_read, site
25
+ Bridgetown::Hooks.trigger :site, :post_read, site
26
+ block&.call(site)
27
+ end
28
+ end
29
+
20
30
  Bridgetown.logger.info "Watcher:", "enabled." unless options[:using_puma]
21
31
 
22
32
  return if options[:serving]
@@ -32,10 +42,9 @@ module Bridgetown
32
42
  #
33
43
  # @param (see #watch)
34
44
  def load_paths_to_watch(site, options)
35
- site.plugin_manager.plugins_path.select { |path| Dir.exist?(path) }
36
- .then do |paths|
37
- (paths + options.autoload_paths).uniq
38
- end
45
+ (site.plugin_manager.plugins_path + options.autoload_paths).uniq.select do |path|
46
+ Dir.exist?(path)
47
+ end
39
48
  end
40
49
 
41
50
  # Start a listener to watch for changes and call {#reload_site}
@@ -119,6 +128,10 @@ module Bridgetown
119
128
  end
120
129
  end
121
130
 
131
+ def component_frontend_matcher
132
+ %r{_components/.*?(\.js|\.jsx|\.js\.rb|\.css)$}
133
+ end
134
+
122
135
  def to_exclude(options)
123
136
  [
124
137
  config_files(options),
@@ -151,7 +164,7 @@ module Bridgetown
151
164
  rescue ArgumentError
152
165
  # Could not find a relative path
153
166
  end
154
- end + [%r!^\.bridgetown-metadata!]
167
+ end + [component_frontend_matcher] + [%r!^\.bridgetown-metadata!]
155
168
  end
156
169
 
157
170
  def sleep_forever
@@ -32,6 +32,7 @@ require "yaml"
32
32
 
33
33
  # 3rd party
34
34
  require "active_support"
35
+ require "active_support/core_ext/class/attribute"
35
36
  require "active_support/core_ext/hash/keys"
36
37
  require "active_support/core_ext/module/delegation"
37
38
  require "active_support/core_ext/object/blank"
@@ -50,10 +51,14 @@ require "listen"
50
51
  require "kramdown"
51
52
  require "colorator"
52
53
  require "i18n"
54
+ require "i18n/backend/fallbacks"
53
55
  require "faraday"
54
56
  require "thor"
55
57
  require "zeitwerk"
56
58
 
59
+ # Ensure we can set up fallbacks so the default locale gets used
60
+ I18n::Backend::Simple.include I18n::Backend::Fallbacks
61
+
57
62
  module HashWithDotAccess
58
63
  class Hash # :nodoc:
59
64
  def to_liquid
@@ -85,12 +90,13 @@ module Bridgetown
85
90
  autoload :LayoutPlaceable, "bridgetown-core/concerns/layout_placeable"
86
91
  autoload :LayoutReader, "bridgetown-core/readers/layout_reader"
87
92
  autoload :LiquidRenderable, "bridgetown-core/concerns/liquid_renderable"
93
+ autoload :Localizable, "bridgetown-core/concerns/localizable"
88
94
  autoload :LiquidRenderer, "bridgetown-core/liquid_renderer"
89
95
  autoload :LogAdapter, "bridgetown-core/log_adapter"
90
96
  autoload :PluginContentReader, "bridgetown-core/readers/plugin_content_reader"
91
97
  autoload :PluginManager, "bridgetown-core/plugin_manager"
98
+ autoload :Prioritizable, "bridgetown-core/concerns/prioritizable"
92
99
  autoload :Publishable, "bridgetown-core/concerns/publishable"
93
- autoload :Publisher, "bridgetown-core/publisher"
94
100
  autoload :Reader, "bridgetown-core/reader"
95
101
  autoload :RubyTemplateView, "bridgetown-core/ruby_template_view"
96
102
  autoload :LogWriter, "bridgetown-core/log_writer"
@@ -160,7 +166,7 @@ module Bridgetown
160
166
 
161
167
  def load_tasks
162
168
  require "bridgetown-core/commands/base"
163
- Bridgetown::PluginManager.require_from_bundler
169
+ Bridgetown::PluginManager.require_from_bundler(skip_yarn: true)
164
170
  load File.expand_path("bridgetown-core/tasks/bridgetown_tasks.rake", __dir__)
165
171
  end
166
172
 
@@ -54,7 +54,7 @@ bin/bridgetown console
54
54
 
55
55
  ## Deployment
56
56
 
57
- You can deploy Bridgetown sites on hosts like Render or Vercel as well as tranditional web servers by simply building and copying the output folder to your HTML root.
57
+ You can deploy Bridgetown sites on hosts like Render or Vercel as well as traditional web servers by simply building and copying the output folder to your HTML root.
58
58
 
59
59
  > Read the [Bridgetown Deployment Documentation](https://www.bridgetownrb.com/docs/deployment) for more information.
60
60
 
@@ -67,4 +67,4 @@ If repo is on GitHub:
67
67
  3. Create your feature branch (`git checkout -b my-new-feature`)
68
68
  4. Commit your changes (`git commit -am 'Add some feature'`)
69
69
  5. Push to the branch (`git push origin my-new-feature`)
70
- 6. Create a new Pull Request
70
+ 6. Create a new Pull Request
@@ -3,6 +3,9 @@
3
3
  # This config file is for settings that affect your whole site, values
4
4
  # which you are expected to set up once and rarely edit after that.
5
5
  #
6
+ # A list of all available configuration options can be found here:
7
+ # https://www.bridgetownrb.com/docs/configuration/options
8
+ #
6
9
  # For technical reasons, this file is *NOT* reloaded automatically when you use
7
10
  # `bin/bridgetown start`. If you change this file, please restart the server process.
8
11
  #
@@ -3,6 +3,7 @@ import "index.css"
3
3
  <%- else -%>
4
4
  import "index.scss"
5
5
  <%- end -%>
6
+ import "syntax-highlighting.css"
6
7
 
7
8
  // Import all JavaScript & CSS files from src/_components
8
9
  <%- if frontend_bundling_option == "esbuild" -%>
@@ -0,0 +1,77 @@
1
+ /*
2
+ Syntax Highlighting for Code Snippets
3
+
4
+ https://www.bridgetownrb.com/docs/liquid/tags#stylesheets-for-syntax-highlighting
5
+
6
+ Other styles available eg. https://github.com/jwarby/jekyll-pygments-themes
7
+ To use another style, delete all styles in this file and replace them with
8
+ the new styles. Or create your own!
9
+
10
+ */
11
+
12
+ pre.highlight {
13
+ padding: 16px;
14
+ background-color: #F6F8FA;
15
+ }
16
+
17
+ .highlight .hll { background-color: #ffffcc }
18
+ .highlight .c { color: #999988; font-style: italic } /* Comment */
19
+ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
20
+ .highlight .k { color: #000000; font-weight: bold } /* Keyword */
21
+ .highlight .o { color: #000000; font-weight: bold } /* Operator */
22
+ .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
23
+ .highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
24
+ .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
25
+ .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
26
+ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
27
+ .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
28
+ .highlight .gr { color: #aa0000 } /* Generic.Error */
29
+ .highlight .gh { color: #999999 } /* Generic.Heading */
30
+ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
31
+ .highlight .go { color: #888888 } /* Generic.Output */
32
+ .highlight .gp { color: #555555 } /* Generic.Prompt */
33
+ .highlight .gs { font-weight: bold } /* Generic.Strong */
34
+ .highlight .gu { color: #aaaaaa } /* Generic.Subheading */
35
+ .highlight .gt { color: #aa0000 } /* Generic.Traceback */
36
+ .highlight .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
37
+ .highlight .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
38
+ .highlight .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
39
+ .highlight .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
40
+ .highlight .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
41
+ .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
42
+ .highlight .m { color: #009999 } /* Literal.Number */
43
+ .highlight .s { color: #d01040 } /* Literal.String */
44
+ .highlight .na { color: #008080 } /* Name.Attribute */
45
+ .highlight .nb { color: #0086B3 } /* Name.Builtin */
46
+ .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
47
+ .highlight .no { color: #008080 } /* Name.Constant */
48
+ .highlight .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
49
+ .highlight .ni { color: #800080 } /* Name.Entity */
50
+ .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
51
+ .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
52
+ .highlight .nl { color: #990000; font-weight: bold } /* Name.Label */
53
+ .highlight .nn { color: #555555 } /* Name.Namespace */
54
+ .highlight .nt { color: #000080 } /* Name.Tag */
55
+ .highlight .nv { color: #008080 } /* Name.Variable */
56
+ .highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
57
+ .highlight .w { color: #bbbbbb } /* Text.Whitespace */
58
+ .highlight .mf { color: #009999 } /* Literal.Number.Float */
59
+ .highlight .mh { color: #009999 } /* Literal.Number.Hex */
60
+ .highlight .mi { color: #009999 } /* Literal.Number.Integer */
61
+ .highlight .mo { color: #009999 } /* Literal.Number.Oct */
62
+ .highlight .sb { color: #d01040 } /* Literal.String.Backtick */
63
+ .highlight .sc { color: #d01040 } /* Literal.String.Char */
64
+ .highlight .sd { color: #d01040 } /* Literal.String.Doc */
65
+ .highlight .s2 { color: #d01040 } /* Literal.String.Double */
66
+ .highlight .se { color: #d01040 } /* Literal.String.Escape */
67
+ .highlight .sh { color: #d01040 } /* Literal.String.Heredoc */
68
+ .highlight .si { color: #d01040 } /* Literal.String.Interpol */
69
+ .highlight .sx { color: #d01040 } /* Literal.String.Other */
70
+ .highlight .sr { color: #009926 } /* Literal.String.Regex */
71
+ .highlight .s1 { color: #d01040 } /* Literal.String.Single */
72
+ .highlight .ss { color: #990073 } /* Literal.String.Symbol */
73
+ .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
74
+ .highlight .vc { color: #008080 } /* Name.Variable.Class */
75
+ .highlight .vg { color: #008080 } /* Name.Variable.Global */
76
+ .highlight .vi { color: #008080 } /* Name.Variable.Instance */
77
+ .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
@@ -13,34 +13,35 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  <%- if frontend_bundling_option == "webpack" -%>
16
- "css-loader": "^4.3.0",
16
+ "css-loader": "^6.7.1",
17
17
  <%- end -%>
18
- "esbuild": "^0.13.15",
18
+ "esbuild": "^0.14.39",
19
19
  <%- if frontend_bundling_option == "webpack" -%>
20
- "esbuild-loader": "^2.16.0",
20
+ "esbuild-loader": "^2.18.0",
21
21
  "file-loader": "^6.2.0",
22
- "mini-css-extract-plugin": "^1.3.1",
22
+ "mini-css-extract-plugin": "^2.6.0",
23
23
  <%- else -%>
24
- "glob": "^7.2.0",
24
+ "glob": "^8.0.1",
25
25
  <%- end -%>
26
- <%- if postcss_option -%>
27
- "postcss": "^8.4.0",
26
+ <%- unless disable_postcss? -%>
27
+ "postcss": "^8.4.12",
28
28
  "postcss-flexbugs-fixes": "^5.0.2",
29
29
  <%- if frontend_bundling_option == "esbuild" -%>
30
- "postcss-import": "^14.0.2",
31
- "postcss-load-config": "^3.1.0",
30
+ "postcss-import": "^14.1.0",
31
+ "postcss-load-config": "^3.1.4",
32
32
  <%- else -%>
33
- "postcss-loader": "^4.3.0",
33
+ "postcss-loader": "^6.2.1",
34
34
  <%- end -%>
35
- "postcss-preset-env": "^7.0.1"<%= "," if frontend_bundling_option == "webpack" %>
36
- <%- else -%>
37
- "sass": "^1.32.8",
38
- "sass-loader": "^8.0.2",
35
+ "postcss-preset-env": "^7.4.3"<%= "," if frontend_bundling_option == "webpack" || !postcss_option %>
36
+ <%- end -%>
37
+ <%- unless postcss_option -%>
38
+ "sass": "^1.50.1",
39
+ "sass-loader": "^12.6.0"<%= "," if frontend_bundling_option == "webpack" %>
39
40
  <%- end -%>
40
41
  <%- if frontend_bundling_option == "webpack" -%>
41
- "webpack": "^5.39.1",
42
- "webpack-cli": "^4.7.2",
43
- "webpack-manifest-plugin": "^3.1.1",
42
+ "webpack": "^5.72.0",
43
+ "webpack-cli": "^4.9.2",
44
+ "webpack-manifest-plugin": "^5.0.0",
44
45
  "webpack-merge": "^5.8.0"
45
46
  <%- end -%>
46
47
  }
@@ -4,21 +4,18 @@
4
4
  #
5
5
  # Learn more at: http://roda.jeremyevans.net
6
6
 
7
- # Uncomment to use file-based dynamic routing in your project (make sure you
8
- # uncomment the gem dependency in your Gemfile as well):
9
- # require "bridgetown-routes"
10
-
11
7
  class RodaApp < Bridgetown::Rack::Roda
12
8
  # Add additional Roda configuration here if needed
13
9
 
14
10
  # Uncomment to use Bridgetown SSR:
15
11
  # plugin :bridgetown_ssr
16
12
 
17
- # And optionally file-based routing:
13
+ # Uncomment to use file-based dynamic routing in your project (make sure you
14
+ # uncomment the gem dependency in your `Gemfile` as well):
18
15
  # plugin :bridgetown_routes
19
16
 
20
17
  route do |r|
21
18
  # Load Roda routes in server/routes (and src/_routes via `bridgetown-routes`)
22
- Bridgetown::Rack::Routes.start! self
19
+ r.bridgetown
23
20
  end
24
21
  end
@@ -5,5 +5,6 @@ layout: default
5
5
 
6
6
  <h1>404</h1>
7
7
 
8
- <p><strong>Page not found :(</strong></p>
8
+ <h2>Page Not Found :(</h2>
9
+
9
10
  <p>The requested page could not be found.</p>
@@ -0,0 +1,10 @@
1
+ ---
2
+ permalink: /500.html
3
+ layout: default
4
+ ---
5
+
6
+ <h1>500</h1>
7
+
8
+ <h2>Internal Server Error :(</h2>
9
+
10
+ <p>The requested page could not be delivered.</p>
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: 1.0.0
4
+ version: 1.1.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-07 00:00:00.000000000 Z
11
+ date: 2022-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -409,6 +409,8 @@ files:
409
409
  - lib/bridgetown-core/concerns/front_matter_importer.rb
410
410
  - lib/bridgetown-core/concerns/layout_placeable.rb
411
411
  - lib/bridgetown-core/concerns/liquid_renderable.rb
412
+ - lib/bridgetown-core/concerns/localizable.rb
413
+ - lib/bridgetown-core/concerns/prioritizable.rb
412
414
  - lib/bridgetown-core/concerns/publishable.rb
413
415
  - lib/bridgetown-core/concerns/site/configurable.rb
414
416
  - lib/bridgetown-core/concerns/site/content.rb
@@ -433,13 +435,23 @@ files:
433
435
  - lib/bridgetown-core/configurations/cypress/cypress_tasks
434
436
  - lib/bridgetown-core/configurations/gh-pages.rb
435
437
  - lib/bridgetown-core/configurations/gh-pages/gh-pages.yml
438
+ - lib/bridgetown-core/configurations/lit.rb
439
+ - lib/bridgetown-core/configurations/lit/esbuild-plugins.js
440
+ - lib/bridgetown-core/configurations/lit/happy-days.lit.js
441
+ - lib/bridgetown-core/configurations/lit/lit-components-entry.js
442
+ - lib/bridgetown-core/configurations/lit/lit-ssr.config.js
436
443
  - lib/bridgetown-core/configurations/minitesting.rb
437
444
  - lib/bridgetown-core/configurations/netlify.rb
438
445
  - lib/bridgetown-core/configurations/netlify/netlify.sh
439
446
  - lib/bridgetown-core/configurations/netlify/netlify.toml
447
+ - lib/bridgetown-core/configurations/open-props.rb
448
+ - lib/bridgetown-core/configurations/open-props/variables.css.erb
440
449
  - lib/bridgetown-core/configurations/purgecss.rb
441
450
  - lib/bridgetown-core/configurations/render.rb
442
451
  - lib/bridgetown-core/configurations/render/render.yaml.erb
452
+ - lib/bridgetown-core/configurations/ruby2js.rb
453
+ - lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb
454
+ - lib/bridgetown-core/configurations/shoelace.rb
443
455
  - lib/bridgetown-core/configurations/stimulus.rb
444
456
  - lib/bridgetown-core/configurations/tailwindcss.rb
445
457
  - lib/bridgetown-core/configurations/tailwindcss/css_imports.css
@@ -478,6 +490,7 @@ files:
478
490
  - lib/bridgetown-core/filters/date_filters.rb
479
491
  - lib/bridgetown-core/filters/from_liquid.rb
480
492
  - lib/bridgetown-core/filters/grouping_filters.rb
493
+ - lib/bridgetown-core/filters/translation_filters.rb
481
494
  - lib/bridgetown-core/filters/url_filters.rb
482
495
  - lib/bridgetown-core/frontmatter_defaults.rb
483
496
  - lib/bridgetown-core/generated_page.rb
@@ -485,6 +498,7 @@ files:
485
498
  - lib/bridgetown-core/generators/prototype_generator.rb
486
499
  - lib/bridgetown-core/helpers.rb
487
500
  - lib/bridgetown-core/hooks.rb
501
+ - lib/bridgetown-core/kramdown/parser/gfm.rb
488
502
  - lib/bridgetown-core/layout.rb
489
503
  - lib/bridgetown-core/liquid_extensions.rb
490
504
  - lib/bridgetown-core/liquid_renderer.rb
@@ -501,7 +515,6 @@ files:
501
515
  - lib/bridgetown-core/model/repo_origin.rb
502
516
  - lib/bridgetown-core/plugin.rb
503
517
  - lib/bridgetown-core/plugin_manager.rb
504
- - lib/bridgetown-core/publisher.rb
505
518
  - lib/bridgetown-core/rack/boot.rb
506
519
  - lib/bridgetown-core/rack/logger.rb
507
520
  - lib/bridgetown-core/rack/roda.rb
@@ -572,6 +585,7 @@ files:
572
585
  - lib/site_template/config/puma.rb
573
586
  - lib/site_template/frontend/javascript/index.js.erb
574
587
  - lib/site_template/frontend/styles/index.css
588
+ - lib/site_template/frontend/styles/syntax-highlighting.css
575
589
  - lib/site_template/package.json.erb
576
590
  - lib/site_template/plugins/builders/.keep
577
591
  - lib/site_template/plugins/site_builder.rb
@@ -580,6 +594,7 @@ files:
580
594
  - lib/site_template/server/roda_app.rb
581
595
  - lib/site_template/server/routes/hello.rb.sample
582
596
  - lib/site_template/src/404.html
597
+ - lib/site_template/src/500.html
583
598
  - lib/site_template/src/_data/site_metadata.yml
584
599
  - lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb
585
600
  - lib/site_template/src/about.md
@@ -607,9 +622,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
607
622
  version: 2.7.0
608
623
  required_rubygems_version: !ruby/object:Gem::Requirement
609
624
  requirements:
610
- - - ">="
625
+ - - ">"
611
626
  - !ruby/object:Gem::Version
612
- version: '0'
627
+ version: 1.3.1
613
628
  requirements: []
614
629
  rubygems_version: 3.1.4
615
630
  signing_key:
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bridgetown
4
- class Publisher
5
- # @param site [Bridgetown::Site]
6
- def initialize(site)
7
- @site = site
8
- end
9
-
10
- def publish?(thing)
11
- can_be_published?(thing) && !hidden_in_the_future?(thing)
12
- end
13
-
14
- def hidden_in_the_future?(thing)
15
- return false unless thing.respond_to?(:date)
16
-
17
- future_allowed =
18
- (thing.respond_to?(:collection) && thing.collection.metadata.future) || @site.config.future
19
- thing_time = thing.date.is_a?(Date) ? thing.date.to_time.to_i : thing.date.to_i
20
- !future_allowed && thing_time > @site.time.to_i
21
- end
22
-
23
- private
24
-
25
- def can_be_published?(thing)
26
- thing.data.fetch("published", true) || @site.config.unpublished
27
- end
28
- end
29
- end