bridgetown-core 1.0.0 → 1.1.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 +6 -1
- data/bridgetown-core.gemspec +0 -1
- data/lib/bridgetown-core/collection.rb +39 -22
- data/lib/bridgetown-core/commands/apply.rb +3 -3
- data/lib/bridgetown-core/commands/build.rb +6 -6
- data/lib/bridgetown-core/commands/concerns/actions.rb +3 -2
- data/lib/bridgetown-core/commands/concerns/build_options.rb +2 -2
- data/lib/bridgetown-core/commands/configure.rb +1 -1
- data/lib/bridgetown-core/commands/console.rb +5 -5
- data/lib/bridgetown-core/commands/doctor.rb +7 -7
- data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +95 -12
- data/lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb +1 -6
- data/lib/bridgetown-core/commands/new.rb +20 -19
- data/lib/bridgetown-core/commands/plugins.rb +47 -9
- data/lib/bridgetown-core/commands/registrations.rb +2 -3
- data/lib/bridgetown-core/commands/serve.rb +2 -2
- data/lib/bridgetown-core/commands/start.rb +3 -0
- data/lib/bridgetown-core/commands/webpack/update.rb +3 -3
- data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +19 -14
- data/lib/bridgetown-core/component.rb +14 -8
- data/lib/bridgetown-core/concerns/localizable.rb +20 -0
- data/lib/bridgetown-core/concerns/prioritizable.rb +44 -0
- data/lib/bridgetown-core/concerns/publishable.rb +11 -1
- data/lib/bridgetown-core/concerns/site/configurable.rb +2 -10
- data/lib/bridgetown-core/concerns/site/localizable.rb +5 -1
- data/lib/bridgetown-core/concerns/site/ssr.rb +3 -3
- data/lib/bridgetown-core/concerns/site/writable.rb +28 -0
- data/lib/bridgetown-core/concerns/transformable.rb +2 -2
- data/lib/bridgetown-core/configuration.rb +4 -2
- data/lib/bridgetown-core/configurations/bt-postcss/postcss.config.js +5 -3
- data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -1
- data/lib/bridgetown-core/configurations/lit/esbuild-plugins.js +21 -0
- data/lib/bridgetown-core/configurations/lit/happy-days.lit.js +26 -0
- data/lib/bridgetown-core/configurations/lit/lit-components-entry.js +1 -0
- data/lib/bridgetown-core/configurations/lit/lit-ssr.config.js +6 -0
- data/lib/bridgetown-core/configurations/lit.rb +95 -0
- data/lib/bridgetown-core/configurations/open-props/variables.css.erb +11 -0
- data/lib/bridgetown-core/configurations/open-props.rb +21 -0
- data/lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb +9 -0
- data/lib/bridgetown-core/configurations/ruby2js.rb +67 -0
- data/lib/bridgetown-core/configurations/shoelace.rb +50 -0
- data/lib/bridgetown-core/configurations/tailwindcss.rb +16 -2
- data/lib/bridgetown-core/configurations/turbo/turbo_transitions.js +1 -1
- data/lib/bridgetown-core/converters/erb_templates.rb +7 -2
- data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/bridgetown-core/converters/serbea_templates.rb +1 -4
- data/lib/bridgetown-core/drops/generated_page_drop.rb +2 -1
- data/lib/bridgetown-core/drops/resource_drop.rb +2 -1
- data/lib/bridgetown-core/errors.rb +5 -5
- data/lib/bridgetown-core/filters/translation_filters.rb +11 -0
- data/lib/bridgetown-core/filters/url_filters.rb +37 -10
- data/lib/bridgetown-core/filters.rb +3 -0
- data/lib/bridgetown-core/frontmatter_defaults.rb +14 -8
- data/lib/bridgetown-core/generated_page.rb +1 -0
- data/lib/bridgetown-core/kramdown/parser/gfm.rb +36 -0
- data/lib/bridgetown-core/model/base.rb +3 -4
- data/lib/bridgetown-core/plugin.rb +6 -37
- data/lib/bridgetown-core/plugin_manager.rb +3 -2
- data/lib/bridgetown-core/rack/boot.rb +7 -2
- data/lib/bridgetown-core/rack/logger.rb +14 -4
- data/lib/bridgetown-core/rack/roda.rb +106 -9
- data/lib/bridgetown-core/rack/routes.rb +67 -2
- data/lib/bridgetown-core/resource/base.rb +9 -6
- data/lib/bridgetown-core/resource/destination.rb +18 -0
- data/lib/bridgetown-core/resource/permalink_processor.rb +6 -4
- data/lib/bridgetown-core/resource/relations.rb +1 -1
- data/lib/bridgetown-core/ruby_template_view.rb +3 -3
- data/lib/bridgetown-core/static_file.rb +1 -1
- data/lib/bridgetown-core/tags/highlight.rb +1 -1
- data/lib/bridgetown-core/tags/post_url.rb +1 -1
- data/lib/bridgetown-core/url.rb +1 -1
- data/lib/bridgetown-core/utils/aux.rb +2 -1
- data/lib/bridgetown-core/utils/require_gems.rb +3 -6
- data/lib/bridgetown-core/utils.rb +24 -11
- data/lib/bridgetown-core/version.rb +2 -2
- data/lib/bridgetown-core/watcher.rb +21 -8
- data/lib/bridgetown-core.rb +8 -2
- data/lib/site_template/Gemfile.erb +4 -0
- data/lib/site_template/README.md +2 -2
- data/lib/site_template/bridgetown.config.yml +3 -0
- data/lib/site_template/frontend/javascript/index.js.erb +1 -0
- data/lib/site_template/frontend/styles/syntax-highlighting.css +77 -0
- data/lib/site_template/package.json.erb +18 -18
- data/lib/site_template/server/roda_app.rb +3 -6
- data/lib/site_template/src/404.html +2 -1
- data/lib/site_template/src/500.html +10 -0
- metadata +20 -19
- 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!^ +!).
|
|
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 =
|
|
399
|
-
|
|
400
|
-
site.frontend_manifest["
|
|
401
|
-
site.frontend_manifest["
|
|
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)
|
|
@@ -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
|
-
|
|
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
|
|
36
|
-
.
|
|
37
|
-
|
|
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}
|
|
@@ -90,8 +99,8 @@ module Bridgetown
|
|
|
90
99
|
|
|
91
100
|
site.process
|
|
92
101
|
end
|
|
93
|
-
Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than" \
|
|
94
|
-
"
|
|
102
|
+
Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than " \
|
|
103
|
+
"#{(Time.now - time).ceil(2)} seconds."
|
|
95
104
|
rescue StandardError => e
|
|
96
105
|
Bridgetown::Errors.print_build_error(e, trace: options[:trace])
|
|
97
106
|
end
|
|
@@ -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
|
data/lib/bridgetown-core.rb
CHANGED
|
@@ -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
|
|
|
@@ -24,6 +24,10 @@ gem "bridgetown", "~> <%= Bridgetown::VERSION %>"
|
|
|
24
24
|
# Uncomment to add file-based dynamic routing to your project:
|
|
25
25
|
# gem "bridgetown-routes", "~> <%= Bridgetown::VERSION %>", group: :bridgetown_plugins
|
|
26
26
|
|
|
27
|
+
# Uncomment to use the Inspectors API to manipulate the output
|
|
28
|
+
# of your HTML or XML resources:
|
|
29
|
+
# gem "nokogiri", "~> 1.13"
|
|
30
|
+
|
|
27
31
|
# Puma is a Rack-compatible server used by Bridgetown
|
|
28
32
|
# (you can optionally limit this to the "development" group)
|
|
29
33
|
gem "puma", "~> 5.6"
|
data/lib/site_template/README.md
CHANGED
|
@@ -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
|
|
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
|
#
|
|
@@ -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,34 @@
|
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
<%- if frontend_bundling_option == "webpack" -%>
|
|
16
|
-
"css-loader": "^
|
|
16
|
+
"css-loader": "^6.7.1",
|
|
17
17
|
<%- end -%>
|
|
18
|
-
"esbuild": "^0.
|
|
18
|
+
"esbuild": "^0.14.39",
|
|
19
19
|
<%- if frontend_bundling_option == "webpack" -%>
|
|
20
|
-
"esbuild-loader": "^2.
|
|
21
|
-
"
|
|
22
|
-
"mini-css-extract-plugin": "^1.3.1",
|
|
20
|
+
"esbuild-loader": "^2.18.0",
|
|
21
|
+
"mini-css-extract-plugin": "^2.6.0",
|
|
23
22
|
<%- else -%>
|
|
24
|
-
"glob": "^
|
|
23
|
+
"glob": "^8.0.1",
|
|
25
24
|
<%- end -%>
|
|
26
|
-
<%-
|
|
27
|
-
"postcss": "^8.4.
|
|
25
|
+
<%- unless disable_postcss? -%>
|
|
26
|
+
"postcss": "^8.4.12",
|
|
28
27
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
29
28
|
<%- if frontend_bundling_option == "esbuild" -%>
|
|
30
|
-
"postcss-import": "^14.0
|
|
31
|
-
"postcss-load-config": "^3.1.
|
|
29
|
+
"postcss-import": "^14.1.0",
|
|
30
|
+
"postcss-load-config": "^3.1.4",
|
|
32
31
|
<%- else -%>
|
|
33
|
-
"postcss-loader": "^
|
|
32
|
+
"postcss-loader": "^6.2.1",
|
|
34
33
|
<%- end -%>
|
|
35
|
-
"postcss-preset-env": "^7.
|
|
36
|
-
<%-
|
|
37
|
-
|
|
38
|
-
"sass
|
|
34
|
+
"postcss-preset-env": "^7.4.3"<%= "," if frontend_bundling_option == "webpack" || !postcss_option %>
|
|
35
|
+
<%- end -%>
|
|
36
|
+
<%- unless postcss_option -%>
|
|
37
|
+
"sass": "^1.50.1",
|
|
38
|
+
"sass-loader": "^12.6.0"<%= "," if frontend_bundling_option == "webpack" %>
|
|
39
39
|
<%- end -%>
|
|
40
40
|
<%- if frontend_bundling_option == "webpack" -%>
|
|
41
|
-
"webpack": "^5.
|
|
42
|
-
"webpack-cli": "^4.
|
|
43
|
-
"webpack-manifest-plugin": "^
|
|
41
|
+
"webpack": "^5.72.0",
|
|
42
|
+
"webpack-cli": "^4.9.2",
|
|
43
|
+
"webpack-manifest-plugin": "^5.0.0",
|
|
44
44
|
"webpack-merge": "^5.8.0"
|
|
45
45
|
<%- end -%>
|
|
46
46
|
}
|
|
@@ -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
|
-
#
|
|
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
|
-
|
|
19
|
+
r.bridgetown
|
|
23
20
|
end
|
|
24
21
|
end
|
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.
|
|
4
|
+
version: 1.1.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: 2022-
|
|
11
|
+
date: 2022-06-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -218,20 +218,6 @@ dependencies:
|
|
|
218
218
|
- - "~>"
|
|
219
219
|
- !ruby/object:Gem::Version
|
|
220
220
|
version: '3.0'
|
|
221
|
-
- !ruby/object:Gem::Dependency
|
|
222
|
-
name: rack-indifferent
|
|
223
|
-
requirement: !ruby/object:Gem::Requirement
|
|
224
|
-
requirements:
|
|
225
|
-
- - ">="
|
|
226
|
-
- !ruby/object:Gem::Version
|
|
227
|
-
version: 1.2.0
|
|
228
|
-
type: :runtime
|
|
229
|
-
prerelease: false
|
|
230
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
231
|
-
requirements:
|
|
232
|
-
- - ">="
|
|
233
|
-
- !ruby/object:Gem::Version
|
|
234
|
-
version: 1.2.0
|
|
235
221
|
- !ruby/object:Gem::Dependency
|
|
236
222
|
name: rake
|
|
237
223
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -409,6 +395,8 @@ files:
|
|
|
409
395
|
- lib/bridgetown-core/concerns/front_matter_importer.rb
|
|
410
396
|
- lib/bridgetown-core/concerns/layout_placeable.rb
|
|
411
397
|
- lib/bridgetown-core/concerns/liquid_renderable.rb
|
|
398
|
+
- lib/bridgetown-core/concerns/localizable.rb
|
|
399
|
+
- lib/bridgetown-core/concerns/prioritizable.rb
|
|
412
400
|
- lib/bridgetown-core/concerns/publishable.rb
|
|
413
401
|
- lib/bridgetown-core/concerns/site/configurable.rb
|
|
414
402
|
- lib/bridgetown-core/concerns/site/content.rb
|
|
@@ -433,13 +421,23 @@ files:
|
|
|
433
421
|
- lib/bridgetown-core/configurations/cypress/cypress_tasks
|
|
434
422
|
- lib/bridgetown-core/configurations/gh-pages.rb
|
|
435
423
|
- lib/bridgetown-core/configurations/gh-pages/gh-pages.yml
|
|
424
|
+
- lib/bridgetown-core/configurations/lit.rb
|
|
425
|
+
- lib/bridgetown-core/configurations/lit/esbuild-plugins.js
|
|
426
|
+
- lib/bridgetown-core/configurations/lit/happy-days.lit.js
|
|
427
|
+
- lib/bridgetown-core/configurations/lit/lit-components-entry.js
|
|
428
|
+
- lib/bridgetown-core/configurations/lit/lit-ssr.config.js
|
|
436
429
|
- lib/bridgetown-core/configurations/minitesting.rb
|
|
437
430
|
- lib/bridgetown-core/configurations/netlify.rb
|
|
438
431
|
- lib/bridgetown-core/configurations/netlify/netlify.sh
|
|
439
432
|
- lib/bridgetown-core/configurations/netlify/netlify.toml
|
|
433
|
+
- lib/bridgetown-core/configurations/open-props.rb
|
|
434
|
+
- lib/bridgetown-core/configurations/open-props/variables.css.erb
|
|
440
435
|
- lib/bridgetown-core/configurations/purgecss.rb
|
|
441
436
|
- lib/bridgetown-core/configurations/render.rb
|
|
442
437
|
- lib/bridgetown-core/configurations/render/render.yaml.erb
|
|
438
|
+
- lib/bridgetown-core/configurations/ruby2js.rb
|
|
439
|
+
- lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb
|
|
440
|
+
- lib/bridgetown-core/configurations/shoelace.rb
|
|
443
441
|
- lib/bridgetown-core/configurations/stimulus.rb
|
|
444
442
|
- lib/bridgetown-core/configurations/tailwindcss.rb
|
|
445
443
|
- lib/bridgetown-core/configurations/tailwindcss/css_imports.css
|
|
@@ -478,6 +476,7 @@ files:
|
|
|
478
476
|
- lib/bridgetown-core/filters/date_filters.rb
|
|
479
477
|
- lib/bridgetown-core/filters/from_liquid.rb
|
|
480
478
|
- lib/bridgetown-core/filters/grouping_filters.rb
|
|
479
|
+
- lib/bridgetown-core/filters/translation_filters.rb
|
|
481
480
|
- lib/bridgetown-core/filters/url_filters.rb
|
|
482
481
|
- lib/bridgetown-core/frontmatter_defaults.rb
|
|
483
482
|
- lib/bridgetown-core/generated_page.rb
|
|
@@ -485,6 +484,7 @@ files:
|
|
|
485
484
|
- lib/bridgetown-core/generators/prototype_generator.rb
|
|
486
485
|
- lib/bridgetown-core/helpers.rb
|
|
487
486
|
- lib/bridgetown-core/hooks.rb
|
|
487
|
+
- lib/bridgetown-core/kramdown/parser/gfm.rb
|
|
488
488
|
- lib/bridgetown-core/layout.rb
|
|
489
489
|
- lib/bridgetown-core/liquid_extensions.rb
|
|
490
490
|
- lib/bridgetown-core/liquid_renderer.rb
|
|
@@ -501,7 +501,6 @@ files:
|
|
|
501
501
|
- lib/bridgetown-core/model/repo_origin.rb
|
|
502
502
|
- lib/bridgetown-core/plugin.rb
|
|
503
503
|
- lib/bridgetown-core/plugin_manager.rb
|
|
504
|
-
- lib/bridgetown-core/publisher.rb
|
|
505
504
|
- lib/bridgetown-core/rack/boot.rb
|
|
506
505
|
- lib/bridgetown-core/rack/logger.rb
|
|
507
506
|
- lib/bridgetown-core/rack/roda.rb
|
|
@@ -572,6 +571,7 @@ files:
|
|
|
572
571
|
- lib/site_template/config/puma.rb
|
|
573
572
|
- lib/site_template/frontend/javascript/index.js.erb
|
|
574
573
|
- lib/site_template/frontend/styles/index.css
|
|
574
|
+
- lib/site_template/frontend/styles/syntax-highlighting.css
|
|
575
575
|
- lib/site_template/package.json.erb
|
|
576
576
|
- lib/site_template/plugins/builders/.keep
|
|
577
577
|
- lib/site_template/plugins/site_builder.rb
|
|
@@ -580,6 +580,7 @@ files:
|
|
|
580
580
|
- lib/site_template/server/roda_app.rb
|
|
581
581
|
- lib/site_template/server/routes/hello.rb.sample
|
|
582
582
|
- lib/site_template/src/404.html
|
|
583
|
+
- lib/site_template/src/500.html
|
|
583
584
|
- lib/site_template/src/_data/site_metadata.yml
|
|
584
585
|
- lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb
|
|
585
586
|
- lib/site_template/src/about.md
|
|
@@ -607,9 +608,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
607
608
|
version: 2.7.0
|
|
608
609
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
609
610
|
requirements:
|
|
610
|
-
- - "
|
|
611
|
+
- - ">"
|
|
611
612
|
- !ruby/object:Gem::Version
|
|
612
|
-
version:
|
|
613
|
+
version: 1.3.1
|
|
613
614
|
requirements: []
|
|
614
615
|
rubygems_version: 3.1.4
|
|
615
616
|
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
|