bridgetown-core 1.0.0.beta2 → 1.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) 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.config.js +20 -16
  7. data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +95 -12
  8. data/lib/bridgetown-core/commands/new.rb +10 -9
  9. data/lib/bridgetown-core/commands/plugins.rb +2 -0
  10. data/lib/bridgetown-core/commands/start.rb +3 -0
  11. data/lib/bridgetown-core/commands/webpack/update.rb +2 -2
  12. data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +11 -2
  13. data/lib/bridgetown-core/component.rb +13 -7
  14. data/lib/bridgetown-core/concerns/localizable.rb +20 -0
  15. data/lib/bridgetown-core/concerns/prioritizable.rb +44 -0
  16. data/lib/bridgetown-core/concerns/publishable.rb +11 -1
  17. data/lib/bridgetown-core/concerns/site/configurable.rb +2 -10
  18. data/lib/bridgetown-core/concerns/site/localizable.rb +5 -1
  19. data/lib/bridgetown-core/concerns/site/renderable.rb +27 -16
  20. data/lib/bridgetown-core/concerns/site/ssr.rb +3 -3
  21. data/lib/bridgetown-core/concerns/site/writable.rb +28 -0
  22. data/lib/bridgetown-core/concerns/transformable.rb +62 -0
  23. data/lib/bridgetown-core/configuration.rb +2 -0
  24. data/lib/bridgetown-core/configurations/bt-postcss/postcss.config.js +5 -3
  25. data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -1
  26. data/lib/bridgetown-core/configurations/gh-pages/gh-pages.yml +33 -0
  27. data/lib/bridgetown-core/configurations/gh-pages.rb +16 -0
  28. data/lib/bridgetown-core/configurations/lit/esbuild-plugins.js +21 -0
  29. data/lib/bridgetown-core/configurations/lit/happy-days.lit.js +26 -0
  30. data/lib/bridgetown-core/configurations/lit/lit-components-entry.js +1 -0
  31. data/lib/bridgetown-core/configurations/lit/lit-ssr.config.js +6 -0
  32. data/lib/bridgetown-core/configurations/lit.rb +95 -0
  33. data/lib/bridgetown-core/configurations/open-props/variables.css.erb +11 -0
  34. data/lib/bridgetown-core/configurations/open-props.rb +21 -0
  35. data/lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb +9 -0
  36. data/lib/bridgetown-core/configurations/ruby2js.rb +67 -0
  37. data/lib/bridgetown-core/configurations/shoelace.rb +50 -0
  38. data/lib/bridgetown-core/configurations/tailwindcss.rb +16 -2
  39. data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
  40. data/lib/bridgetown-core/drops/generated_page_drop.rb +2 -1
  41. data/lib/bridgetown-core/drops/resource_drop.rb +2 -1
  42. data/lib/bridgetown-core/errors.rb +5 -5
  43. data/lib/bridgetown-core/filters/translation_filters.rb +11 -0
  44. data/lib/bridgetown-core/filters/url_filters.rb +37 -10
  45. data/lib/bridgetown-core/filters.rb +3 -0
  46. data/lib/bridgetown-core/frontmatter_defaults.rb +14 -8
  47. data/lib/bridgetown-core/generated_page.rb +82 -17
  48. data/lib/bridgetown-core/kramdown/parser/gfm.rb +36 -0
  49. data/lib/bridgetown-core/model/base.rb +1 -2
  50. data/lib/bridgetown-core/plugin.rb +6 -37
  51. data/lib/bridgetown-core/plugin_manager.rb +3 -2
  52. data/lib/bridgetown-core/rack/boot.rb +5 -0
  53. data/lib/bridgetown-core/rack/logger.rb +14 -4
  54. data/lib/bridgetown-core/rack/roda.rb +102 -10
  55. data/lib/bridgetown-core/rack/routes.rb +87 -6
  56. data/lib/bridgetown-core/resource/base.rb +4 -6
  57. data/lib/bridgetown-core/resource/destination.rb +18 -0
  58. data/lib/bridgetown-core/resource/permalink_processor.rb +6 -4
  59. data/lib/bridgetown-core/resource/relations.rb +1 -1
  60. data/lib/bridgetown-core/resource/transformer.rb +21 -85
  61. data/lib/bridgetown-core/utils/aux.rb +2 -1
  62. data/lib/bridgetown-core/utils/require_gems.rb +3 -6
  63. data/lib/bridgetown-core/utils.rb +25 -12
  64. data/lib/bridgetown-core/version.rb +2 -2
  65. data/lib/bridgetown-core/watcher.rb +19 -6
  66. data/lib/bridgetown-core.rb +9 -3
  67. data/lib/site_template/Gemfile.erb +1 -1
  68. data/lib/site_template/README.md +2 -2
  69. data/lib/site_template/TEMPLATES/erb/_components/shared/navbar.erb +4 -4
  70. data/lib/site_template/TEMPLATES/liquid/_components/navbar.liquid +4 -4
  71. data/lib/site_template/TEMPLATES/serbea/_components/shared/navbar.serb +4 -4
  72. data/lib/site_template/bridgetown.config.yml +10 -3
  73. data/lib/site_template/frontend/javascript/index.js.erb +1 -0
  74. data/lib/site_template/frontend/styles/syntax-highlighting.css +77 -0
  75. data/lib/site_template/package.json.erb +18 -17
  76. data/lib/site_template/server/roda_app.rb +3 -6
  77. data/lib/site_template/src/404.html +2 -1
  78. data/lib/site_template/src/500.html +10 -0
  79. metadata +21 -4
  80. data/lib/bridgetown-core/publisher.rb +0 -29
  81. data/lib/bridgetown-core/renderer.rb +0 -169
@@ -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,18 +90,19 @@ 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
- autoload :Renderer, "bridgetown-core/renderer"
96
101
  autoload :RubyTemplateView, "bridgetown-core/ruby_template_view"
97
102
  autoload :LogWriter, "bridgetown-core/log_writer"
98
103
  autoload :Site, "bridgetown-core/site"
99
104
  autoload :StaticFile, "bridgetown-core/static_file"
105
+ autoload :Transformable, "bridgetown-core/concerns/transformable"
100
106
  autoload :URL, "bridgetown-core/url"
101
107
  autoload :Utils, "bridgetown-core/utils"
102
108
  autoload :VERSION, "bridgetown-core/version"
@@ -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
 
@@ -26,4 +26,4 @@ gem "bridgetown", "~> <%= Bridgetown::VERSION %>"
26
26
 
27
27
  # Puma is a Rack-compatible server used by Bridgetown
28
28
  # (you can optionally limit this to the "development" group)
29
- gem "puma", "~> 5.5"
29
+ gem "puma", "~> 5.6"
@@ -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
@@ -1,11 +1,11 @@
1
1
  <header>
2
- <img src="/images/logo.svg" alt="Logo" />
2
+ <img src="<%= relative_url '/images/logo.svg' %>" alt="Logo" />
3
3
  </header>
4
4
 
5
5
  <nav>
6
6
  <ul>
7
- <li><a href="/">Home</a></li>
8
- <li><a href="/about">About</a></li>
9
- <li><a href="/posts">Posts</a></li>
7
+ <li><a href="<%= relative_url '/' %>">Home</a></li>
8
+ <li><a href="<%= relative_url '/about' %>">About</a></li>
9
+ <li><a href="<%= relative_url '/posts' %>">Posts</a></li>
10
10
  </ul>
11
11
  </nav>
@@ -1,11 +1,11 @@
1
1
  <header>
2
- <img src="/images/logo.svg" alt="Logo" />
2
+ <img src="{{ '/images/logo.svg' | relative_url }}" alt="Logo" />
3
3
  </header>
4
4
 
5
5
  <nav>
6
6
  <ul>
7
- <li><a href="/">Home</a></li>
8
- <li><a href="/about">About</a></li>
9
- <li><a href="/posts">Posts</a></li>
7
+ <li><a href="{{ '/' | relative_url }}">Home</a></li>
8
+ <li><a href="{{ '/about' | relative_url }}">About</a></li>
9
+ <li><a href="{{ '/posts' | relative_url }}">Posts</a></li>
10
10
  </ul>
11
11
  </nav>
@@ -1,11 +1,11 @@
1
1
  <header>
2
- <img src="/images/logo.svg" alt="Logo" />
2
+ <img src="{{ '/images/logo.svg' | relative_url }}" alt="Logo" />
3
3
  </header>
4
4
 
5
5
  <nav>
6
6
  <ul>
7
- <li><a href="/">Home</a></li>
8
- <li><a href="/about">About</a></li>
9
- <li><a href="/posts">Posts</a></li>
7
+ <li><a href="{{ '/' | relative_url }}">Home</a></li>
8
+ <li><a href="{{ '/about' | relative_url }}">About</a></li>
9
+ <li><a href="{{ '/posts' | relative_url }}">Posts</a></li>
10
10
  </ul>
11
11
  </nav>
@@ -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
  #
@@ -19,8 +22,12 @@ url: "" # the base hostname & protocol for your site, e.g. https://example.com
19
22
  permalink: pretty
20
23
 
21
24
  # Other options you might want to investigate:
22
- #
23
- # base_path: "/" # the subpath of your site, e.g. /blog
25
+ #
26
+ # base_path: "/" # the subpath of your site, e.g. /blog. If you set this option,
27
+ # ensure you use the `relative_url` helper for all links and assets in your HTML.
28
+ # If you're using esbuild for frontend assets, edit `esbuild.config.js` to
29
+ # update `publicPath`.
30
+
24
31
  # timezone: America/Los_Angeles
25
32
  # pagination:
26
- # enabled: true
33
+ # enabled: true
@@ -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.beta2
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-01-26 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
@@ -418,6 +420,7 @@ files:
418
420
  - lib/bridgetown-core/concerns/site/renderable.rb
419
421
  - lib/bridgetown-core/concerns/site/ssr.rb
420
422
  - lib/bridgetown-core/concerns/site/writable.rb
423
+ - lib/bridgetown-core/concerns/transformable.rb
421
424
  - lib/bridgetown-core/configuration.rb
422
425
  - lib/bridgetown-core/configurations/.keep
423
426
  - lib/bridgetown-core/configurations/bt-postcss.rb
@@ -430,13 +433,25 @@ files:
430
433
  - lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js
431
434
  - lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js
432
435
  - lib/bridgetown-core/configurations/cypress/cypress_tasks
436
+ - lib/bridgetown-core/configurations/gh-pages.rb
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
433
443
  - lib/bridgetown-core/configurations/minitesting.rb
434
444
  - lib/bridgetown-core/configurations/netlify.rb
435
445
  - lib/bridgetown-core/configurations/netlify/netlify.sh
436
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
437
449
  - lib/bridgetown-core/configurations/purgecss.rb
438
450
  - lib/bridgetown-core/configurations/render.rb
439
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
440
455
  - lib/bridgetown-core/configurations/stimulus.rb
441
456
  - lib/bridgetown-core/configurations/tailwindcss.rb
442
457
  - lib/bridgetown-core/configurations/tailwindcss/css_imports.css
@@ -475,6 +490,7 @@ files:
475
490
  - lib/bridgetown-core/filters/date_filters.rb
476
491
  - lib/bridgetown-core/filters/from_liquid.rb
477
492
  - lib/bridgetown-core/filters/grouping_filters.rb
493
+ - lib/bridgetown-core/filters/translation_filters.rb
478
494
  - lib/bridgetown-core/filters/url_filters.rb
479
495
  - lib/bridgetown-core/frontmatter_defaults.rb
480
496
  - lib/bridgetown-core/generated_page.rb
@@ -482,6 +498,7 @@ files:
482
498
  - lib/bridgetown-core/generators/prototype_generator.rb
483
499
  - lib/bridgetown-core/helpers.rb
484
500
  - lib/bridgetown-core/hooks.rb
501
+ - lib/bridgetown-core/kramdown/parser/gfm.rb
485
502
  - lib/bridgetown-core/layout.rb
486
503
  - lib/bridgetown-core/liquid_extensions.rb
487
504
  - lib/bridgetown-core/liquid_renderer.rb
@@ -498,7 +515,6 @@ files:
498
515
  - lib/bridgetown-core/model/repo_origin.rb
499
516
  - lib/bridgetown-core/plugin.rb
500
517
  - lib/bridgetown-core/plugin_manager.rb
501
- - lib/bridgetown-core/publisher.rb
502
518
  - lib/bridgetown-core/rack/boot.rb
503
519
  - lib/bridgetown-core/rack/logger.rb
504
520
  - lib/bridgetown-core/rack/roda.rb
@@ -508,7 +524,6 @@ files:
508
524
  - lib/bridgetown-core/readers/defaults_reader.rb
509
525
  - lib/bridgetown-core/readers/layout_reader.rb
510
526
  - lib/bridgetown-core/readers/plugin_content_reader.rb
511
- - lib/bridgetown-core/renderer.rb
512
527
  - lib/bridgetown-core/resource/base.rb
513
528
  - lib/bridgetown-core/resource/destination.rb
514
529
  - lib/bridgetown-core/resource/permalink_processor.rb
@@ -570,6 +585,7 @@ files:
570
585
  - lib/site_template/config/puma.rb
571
586
  - lib/site_template/frontend/javascript/index.js.erb
572
587
  - lib/site_template/frontend/styles/index.css
588
+ - lib/site_template/frontend/styles/syntax-highlighting.css
573
589
  - lib/site_template/package.json.erb
574
590
  - lib/site_template/plugins/builders/.keep
575
591
  - lib/site_template/plugins/site_builder.rb
@@ -578,6 +594,7 @@ files:
578
594
  - lib/site_template/server/roda_app.rb
579
595
  - lib/site_template/server/routes/hello.rb.sample
580
596
  - lib/site_template/src/404.html
597
+ - lib/site_template/src/500.html
581
598
  - lib/site_template/src/_data/site_metadata.yml
582
599
  - lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb
583
600
  - lib/site_template/src/about.md
@@ -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