bridgetown-core 1.1.0 → 1.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bridgetown +1 -3
- data/bridgetown-core.gemspec +7 -6
- data/lib/bridgetown-core/collection.rb +5 -2
- data/lib/bridgetown-core/commands/base.rb +1 -1
- data/lib/bridgetown-core/commands/build.rb +18 -5
- data/lib/bridgetown-core/commands/clean.rb +1 -1
- data/lib/bridgetown-core/commands/concerns/actions.rb +2 -4
- data/lib/bridgetown-core/commands/concerns/configuration_overridable.rb +7 -8
- data/lib/bridgetown-core/commands/console.rb +20 -1
- data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +5 -0
- data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +8 -7
- data/lib/bridgetown-core/commands/esbuild/migrate-from-webpack.rb +1 -1
- data/lib/bridgetown-core/commands/plugins.rb +46 -32
- data/lib/bridgetown-core/commands/serve.rb +1 -2
- data/lib/bridgetown-core/commands/start.rb +0 -8
- data/lib/bridgetown-core/component.rb +50 -0
- data/lib/bridgetown-core/concerns/site/configurable.rb +22 -18
- data/lib/bridgetown-core/concerns/site/localizable.rb +2 -6
- data/lib/bridgetown-core/concerns/site/processable.rb +0 -1
- data/lib/bridgetown-core/concerns/site/ssr.rb +0 -1
- data/lib/bridgetown-core/concerns/transformable.rb +5 -2
- data/lib/bridgetown-core/configuration/configuration_dsl.rb +146 -0
- data/lib/bridgetown-core/configuration.rb +90 -15
- data/lib/bridgetown-core/configurations/gh-pages/gh-pages.yml +3 -1
- data/lib/bridgetown-core/configurations/lit/esbuild-plugins.js +5 -2
- data/lib/bridgetown-core/configurations/minitesting.rb +1 -1
- data/lib/bridgetown-core/converter.rb +8 -0
- data/lib/bridgetown-core/converters/identity.rb +2 -0
- data/lib/bridgetown-core/converters/liquid_templates.rb +1 -0
- data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/bridgetown-core/converters/markdown.rb +2 -0
- data/lib/bridgetown-core/current.rb +19 -5
- data/lib/bridgetown-core/deprecator.rb +4 -37
- data/lib/bridgetown-core/filters.rb +1 -3
- data/lib/bridgetown-core/generated_page.rb +5 -0
- data/lib/bridgetown-core/helpers.rb +119 -8
- data/lib/bridgetown-core/hooks.rb +1 -0
- data/lib/bridgetown-core/kramdown/parser/gfm.rb +1 -1
- data/lib/bridgetown-core/layout.rb +1 -1
- data/lib/bridgetown-core/model/base.rb +11 -12
- data/lib/bridgetown-core/model/builder_origin.rb +1 -1
- data/lib/bridgetown-core/model/origin.rb +5 -1
- data/lib/bridgetown-core/model/plugin_origin.rb +1 -1
- data/lib/bridgetown-core/model/repo_origin.rb +7 -7
- data/lib/bridgetown-core/plugin.rb +2 -6
- data/lib/bridgetown-core/plugin_manager.rb +120 -41
- data/lib/bridgetown-core/rack/boot.rb +3 -7
- data/lib/bridgetown-core/rack/logger.rb +1 -0
- data/lib/bridgetown-core/rack/roda.rb +39 -45
- data/lib/bridgetown-core/rack/routes.rb +2 -6
- data/lib/bridgetown-core/rack/static_indexes.rb +1 -2
- data/lib/bridgetown-core/reader.rb +39 -50
- data/lib/bridgetown-core/readers/layout_reader.rb +1 -1
- data/lib/bridgetown-core/resource/base.rb +17 -1
- data/lib/bridgetown-core/ruby_template_view.rb +12 -8
- data/lib/bridgetown-core/site.rb +10 -3
- data/lib/bridgetown-core/slot.rb +41 -0
- data/lib/bridgetown-core/tasks/bridgetown_tasks.rake +23 -9
- data/lib/bridgetown-core/utils/ansi.rb +1 -1
- data/lib/bridgetown-core/utils/aux.rb +7 -6
- data/lib/bridgetown-core/utils/initializers.rb +45 -0
- data/lib/bridgetown-core/utils/loaders_manager.rb +2 -2
- data/lib/bridgetown-core/utils/require_gems.rb +11 -35
- data/lib/bridgetown-core/utils/ruby_front_matter.rb +2 -3
- data/lib/bridgetown-core/{converters/smartypants.rb → utils/smarty_pants_converter.rb} +5 -24
- data/lib/bridgetown-core/utils.rb +1 -0
- data/lib/bridgetown-core/version.rb +2 -2
- data/lib/bridgetown-core/watcher.rb +1 -8
- data/lib/bridgetown-core.rb +89 -6
- data/lib/roda/plugins/bridgetown_boot.rb +25 -0
- data/lib/roda/plugins/bridgetown_ssr.rb +23 -0
- data/lib/roda/plugins/initializers.rb +17 -0
- data/lib/site_template/.gitignore +1 -0
- data/lib/site_template/Gemfile.erb +1 -1
- data/lib/site_template/TEMPLATES/erb/_layouts/default.erb +2 -2
- data/lib/site_template/TEMPLATES/erb/_layouts/page.erb +1 -1
- data/lib/site_template/TEMPLATES/erb/_layouts/post.erb +1 -1
- data/lib/site_template/TEMPLATES/liquid/_layouts/default.liquid +2 -2
- data/lib/site_template/TEMPLATES/liquid/_layouts/page.liquid +1 -1
- data/lib/site_template/TEMPLATES/liquid/_layouts/post.liquid +1 -1
- data/lib/site_template/TEMPLATES/serbea/_layouts/default.serb +2 -2
- data/lib/site_template/TEMPLATES/serbea/_layouts/page.serb +1 -1
- data/lib/site_template/TEMPLATES/serbea/_layouts/post.serb +1 -1
- data/lib/site_template/config/initializers.rb +43 -0
- data/lib/site_template/package.json.erb +1 -1
- data/lib/site_template/server/roda_app.rb +2 -8
- metadata +17 -9
@@ -4,30 +4,6 @@ module Bridgetown
|
|
4
4
|
module Utils
|
5
5
|
module RequireGems
|
6
6
|
class << self
|
7
|
-
#
|
8
|
-
# Require a gem or file if it's present, otherwise silently fail.
|
9
|
-
#
|
10
|
-
# names - a string gem name or array of gem names
|
11
|
-
#
|
12
|
-
def require_if_present(names)
|
13
|
-
Array(names).each do |name|
|
14
|
-
require name
|
15
|
-
rescue LoadError
|
16
|
-
Bridgetown.logger.debug "Couldn't load #{name}. Skipping."
|
17
|
-
yield(name, version_constraint(name)) if block_given?
|
18
|
-
false
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# The version constraint required to activate a given gem.
|
24
|
-
#
|
25
|
-
# Returns a String version constraint in a parseable form for
|
26
|
-
# RubyGems.
|
27
|
-
def version_constraint
|
28
|
-
"> 0"
|
29
|
-
end
|
30
|
-
|
31
7
|
#
|
32
8
|
# Require a gem or gems. If it's not present, show a very nice error
|
33
9
|
# message that explains everything and is much more helpful than the
|
@@ -38,17 +14,17 @@ module Bridgetown
|
|
38
14
|
def require_with_graceful_fail(names)
|
39
15
|
Array(names).each do |name|
|
40
16
|
Bridgetown.logger.debug "Requiring:", name.to_s
|
41
|
-
require name
|
42
|
-
rescue LoadError =>
|
43
|
-
Bridgetown.logger.error
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
17
|
+
require name.to_s
|
18
|
+
rescue LoadError => _e
|
19
|
+
Bridgetown.logger.error(
|
20
|
+
"Dependency Error:",
|
21
|
+
"Hmm, it looks like you don't have `#{name}' or one of its dependencies " \
|
22
|
+
"installed. Please double-check you've added it to your Gemfile."
|
23
|
+
)
|
24
|
+
Bridgetown.logger.error(
|
25
|
+
"", "You can also find help at https://www.bridgetownrb.com/community"
|
26
|
+
)
|
27
|
+
exit(1)
|
52
28
|
end
|
53
29
|
end
|
54
30
|
end
|
@@ -9,9 +9,8 @@ module Bridgetown
|
|
9
9
|
end
|
10
10
|
|
11
11
|
class RubyFrontMatter
|
12
|
-
def initialize(scope: nil)
|
13
|
-
@data =
|
14
|
-
@scope = scope
|
12
|
+
def initialize(scope: nil, data: {})
|
13
|
+
@data, @scope = data, scope
|
15
14
|
end
|
16
15
|
|
17
16
|
def method_missing(key, *value, &block) # rubocop:disable Metrics/CyclomaticComplexity, Style/MissingRespondToMissing
|
@@ -18,35 +18,16 @@ module Kramdown
|
|
18
18
|
end
|
19
19
|
|
20
20
|
module Bridgetown
|
21
|
-
module
|
22
|
-
|
23
|
-
|
24
|
-
class SmartyPants < Converter
|
25
|
-
priority :low
|
26
|
-
|
21
|
+
module Utils
|
22
|
+
class SmartyPantsConverter
|
23
|
+
# @param config [Bridgetown::Configuration]
|
27
24
|
def initialize(config)
|
28
|
-
super
|
29
|
-
unless defined?(Kramdown)
|
30
|
-
Bridgetown::Utils::RequireGems.require_with_graceful_fail "kramdown"
|
31
|
-
end
|
32
25
|
@config = config["kramdown"].dup || {}
|
33
26
|
@config[:input] = :SmartyPants
|
34
27
|
end
|
35
28
|
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# ext - The String extension or original file.
|
39
|
-
#
|
40
|
-
# Returns The String output file extension.
|
41
|
-
def output_ext(_ext)
|
42
|
-
nil
|
43
|
-
end
|
44
|
-
|
45
|
-
# Logic to do the content conversion.
|
46
|
-
#
|
47
|
-
# content - String content of file (without front matter).
|
48
|
-
#
|
49
|
-
# Returns a String of the converted content.
|
29
|
+
# @param content [String]
|
30
|
+
# @return String
|
50
31
|
def convert(content)
|
51
32
|
document = Kramdown::Document.new(content, @config)
|
52
33
|
html_output = document.to_html.chomp
|
@@ -10,6 +10,7 @@ module Bridgetown
|
|
10
10
|
autoload :RubyExec, "bridgetown-core/utils/ruby_exec"
|
11
11
|
autoload :RubyFrontMatter, "bridgetown-core/utils/ruby_front_matter"
|
12
12
|
autoload :RubyFrontMatterDSL, "bridgetown-core/utils/ruby_front_matter"
|
13
|
+
autoload :SmartyPantsConverter, "bridgetown-core/utils/smarty_pants_converter"
|
13
14
|
|
14
15
|
# Constants for use in #slugify
|
15
16
|
SLUGIFY_MODES = %w(raw default pretty simple ascii latin).freeze
|
@@ -84,7 +84,7 @@ module Bridgetown
|
|
84
84
|
begin
|
85
85
|
time = Time.now
|
86
86
|
I18n.reload! # make sure any locale files get read again
|
87
|
-
Bridgetown::Current.site = site # needed in SSR mode apparently
|
87
|
+
Bridgetown::Current.sites[site.label] = site # needed in SSR mode apparently
|
88
88
|
catch :halt do
|
89
89
|
Bridgetown::Hooks.trigger :site, :pre_reload, site, paths
|
90
90
|
Bridgetown::Hooks.clear_reloadable_hooks
|
@@ -122,19 +122,12 @@ module Bridgetown
|
|
122
122
|
Array(options["exclude"]).map { |e| Bridgetown.sanitized_path(options["source"], e) }
|
123
123
|
end
|
124
124
|
|
125
|
-
def config_files(options)
|
126
|
-
%w(yml yaml toml).map do |ext|
|
127
|
-
Bridgetown.sanitized_path(options["source"], "_config.#{ext}")
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
125
|
def component_frontend_matcher
|
132
126
|
%r{_components/.*?(\.js|\.jsx|\.js\.rb|\.css)$}
|
133
127
|
end
|
134
128
|
|
135
129
|
def to_exclude(options)
|
136
130
|
[
|
137
|
-
config_files(options),
|
138
131
|
options["destination"],
|
139
132
|
custom_excludes(options),
|
140
133
|
].flatten
|
data/lib/bridgetown-core.rb
CHANGED
@@ -101,6 +101,7 @@ module Bridgetown
|
|
101
101
|
autoload :RubyTemplateView, "bridgetown-core/ruby_template_view"
|
102
102
|
autoload :LogWriter, "bridgetown-core/log_writer"
|
103
103
|
autoload :Site, "bridgetown-core/site"
|
104
|
+
autoload :Slot, "bridgetown-core/slot"
|
104
105
|
autoload :StaticFile, "bridgetown-core/static_file"
|
105
106
|
autoload :Transformable, "bridgetown-core/concerns/transformable"
|
106
107
|
autoload :URL, "bridgetown-core/url"
|
@@ -134,6 +135,13 @@ module Bridgetown
|
|
134
135
|
end
|
135
136
|
alias_method :env, :environment
|
136
137
|
|
138
|
+
def begin!
|
139
|
+
ENV["RACK_ENV"] = ENV["BRIDGETOWN_ENV"]
|
140
|
+
|
141
|
+
Bridgetown::Current.preloaded_configuration = Bridgetown::Configuration::Preflight.new
|
142
|
+
Bridgetown::PluginManager.setup_bundler
|
143
|
+
end
|
144
|
+
|
137
145
|
# Generate a Bridgetown configuration hash by merging the default
|
138
146
|
# options with anything in bridgetown.config.yml, and adding the given
|
139
147
|
# options on top.
|
@@ -146,18 +154,74 @@ module Bridgetown
|
|
146
154
|
# @return [Hash] The final configuration hash.
|
147
155
|
def configuration(override = {})
|
148
156
|
config = Configuration.new
|
149
|
-
override = Configuration
|
157
|
+
override = Configuration.new(override)
|
150
158
|
unless override.delete("skip_config_files")
|
151
159
|
config = config.read_config_files(config.config_files(override))
|
152
160
|
end
|
153
161
|
|
154
162
|
# Merge DEFAULTS < bridgetown.config.yml < override
|
163
|
+
# @param obj [Bridgetown::Configuration]
|
155
164
|
Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |obj|
|
156
165
|
set_timezone(obj["timezone"]) if obj["timezone"]
|
166
|
+
|
167
|
+
# Copy "global" source manifests and initializers into this new configuration
|
168
|
+
if Bridgetown::Current.preloaded_configuration.is_a?(Bridgetown::Configuration::Preflight)
|
169
|
+
obj.source_manifests = Bridgetown::Current.preloaded_configuration.source_manifests
|
170
|
+
|
171
|
+
if Bridgetown::Current.preloaded_configuration.initializers
|
172
|
+
obj.initializers = Bridgetown::Current.preloaded_configuration.initializers
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
Bridgetown::Current.preloaded_configuration = obj
|
157
177
|
end
|
158
178
|
end
|
159
179
|
|
160
|
-
|
180
|
+
def initializer(name, prepend: false, replace: false, &block) # rubocop:todo Metrics
|
181
|
+
unless Bridgetown::Current.preloaded_configuration
|
182
|
+
raise "The `#{name}' initializer in #{block.source_location[0]} was called " \
|
183
|
+
"without a preloaded configuration"
|
184
|
+
end
|
185
|
+
|
186
|
+
Bridgetown::Current.preloaded_configuration.initializers ||= {}
|
187
|
+
|
188
|
+
if Bridgetown::Current.preloaded_configuration.initializers.key?(name.to_sym)
|
189
|
+
if replace
|
190
|
+
Bridgetown.logger.warn(
|
191
|
+
"Initializing:",
|
192
|
+
"The previous `#{name}' initializer was replaced by a new initializer"
|
193
|
+
)
|
194
|
+
else
|
195
|
+
prev_block = Bridgetown::Current.preloaded_configuration.initializers[name.to_sym].block
|
196
|
+
new_block = block
|
197
|
+
block = if prepend
|
198
|
+
proc do |*args, **kwargs|
|
199
|
+
new_block.(*args, **kwargs)
|
200
|
+
prev_block.(*args, **kwargs)
|
201
|
+
end
|
202
|
+
else
|
203
|
+
proc do |*args, **kwargs|
|
204
|
+
prev_block.(*args, **kwargs)
|
205
|
+
new_block.(*args, **kwargs)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
Bridgetown::Current.preloaded_configuration.initializers[name.to_sym] =
|
212
|
+
Bridgetown::Configuration::Initializer.new(
|
213
|
+
name: name.to_sym,
|
214
|
+
block: block,
|
215
|
+
completed: false
|
216
|
+
)
|
217
|
+
end
|
218
|
+
|
219
|
+
# @yieldself [Bridgetown::Configuration::ConfigurationDSL]
|
220
|
+
def configure(&block)
|
221
|
+
initializer :init, &block
|
222
|
+
end
|
223
|
+
|
224
|
+
# Convenience method to register a new Thor command
|
161
225
|
#
|
162
226
|
# @see Bridgetown::Commands::Registrations.register
|
163
227
|
def register_command(&block)
|
@@ -166,10 +230,28 @@ module Bridgetown
|
|
166
230
|
|
167
231
|
def load_tasks
|
168
232
|
require "bridgetown-core/commands/base"
|
169
|
-
Bridgetown::PluginManager.
|
233
|
+
Bridgetown::PluginManager.setup_bundler(skip_yarn: true)
|
234
|
+
if Bridgetown::Current.preloaded_configuration.is_a?(Bridgetown::Configuration::Preflight)
|
235
|
+
Bridgetown::Current.preloaded_configuration = Bridgetown.configuration
|
236
|
+
else
|
237
|
+
Bridgetown::Current.preloaded_configuration ||= Bridgetown.configuration
|
238
|
+
end
|
170
239
|
load File.expand_path("bridgetown-core/tasks/bridgetown_tasks.rake", __dir__)
|
171
240
|
end
|
172
241
|
|
242
|
+
# Loads ENV configuration via dotenv gem, if available
|
243
|
+
#
|
244
|
+
# @param root [String] root of Bridgetown site
|
245
|
+
def load_dotenv(root:)
|
246
|
+
dotenv_files = [
|
247
|
+
File.join(root, ".env.#{Bridgetown.env}.local"),
|
248
|
+
(File.join(root, ".env.local") unless Bridgetown.env.test?),
|
249
|
+
File.join(root, ".env.#{Bridgetown.env}"),
|
250
|
+
File.join(root, ".env"),
|
251
|
+
].compact
|
252
|
+
Dotenv.load(*dotenv_files)
|
253
|
+
end
|
254
|
+
|
173
255
|
# Determines the correct Bundler environment block method to use and passes
|
174
256
|
# the block on to it.
|
175
257
|
#
|
@@ -214,6 +296,10 @@ module Bridgetown
|
|
214
296
|
#
|
215
297
|
# @return [Array<Bridgetown::Site>] the Bridgetown sites created.
|
216
298
|
def sites
|
299
|
+
Deprecator.deprecation_message(
|
300
|
+
"Bridgetown.sites will be removed in the next version. Use Bridgetown::Current.sites" \
|
301
|
+
"instead"
|
302
|
+
)
|
217
303
|
[Bridgetown::Current.site].compact
|
218
304
|
end
|
219
305
|
|
@@ -246,9 +332,6 @@ module Bridgetown
|
|
246
332
|
File.join(base_directory, clean_path)
|
247
333
|
end
|
248
334
|
end
|
249
|
-
|
250
|
-
# Conditional optimizations
|
251
|
-
Bridgetown::Utils::RequireGems.require_if_present("liquid/c")
|
252
335
|
end
|
253
336
|
end
|
254
337
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Roda
|
4
|
+
module RodaPlugins
|
5
|
+
module BridgetownBoot
|
6
|
+
Roda::RodaRequest.alias_method :_previous_roda_cookies, :cookies
|
7
|
+
|
8
|
+
module RequestMethods
|
9
|
+
# Monkeypatch Roda/Rack's Request object so it returns a hash which allows for
|
10
|
+
# indifferent access
|
11
|
+
def cookies
|
12
|
+
# TODO: maybe replace with a simpler hash that offers an overloaded `[]` method
|
13
|
+
_previous_roda_cookies.with_indifferent_access
|
14
|
+
end
|
15
|
+
|
16
|
+
# Starts up the Bridgetown routing system
|
17
|
+
def bridgetown
|
18
|
+
Bridgetown::Rack::Routes.start!(scope)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
register_plugin :bridgetown_boot, BridgetownBoot
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Roda
|
4
|
+
module RodaPlugins
|
5
|
+
module BridgetownSSR
|
6
|
+
module InstanceMethods
|
7
|
+
# Helper to get the site associated with the Roda app
|
8
|
+
# @return [Bridgetown::Site]
|
9
|
+
def bridgetown_site
|
10
|
+
self.class.opts[:bridgetown_site]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.configure(app, _opts = {}, &block)
|
15
|
+
app.include Bridgetown::Filters::URLFilters
|
16
|
+
app.opts[:bridgetown_site] =
|
17
|
+
Bridgetown::Site.start_ssr!(loaders_manager: Bridgetown::Rack.loaders_manager, &block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
register_plugin :bridgetown_ssr, BridgetownSSR
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Roda
|
4
|
+
module RodaPlugins
|
5
|
+
module Initializers
|
6
|
+
def self.load_dependencies(app)
|
7
|
+
Bridgetown::Current.preloaded_configuration.initialize_roda_app(app)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.configure(app, _opts = {})
|
11
|
+
app.opts[:bridgetown_preloaded_config] = Bridgetown::Current.preloaded_configuration
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
register_plugin :initializers, Initializers
|
16
|
+
end
|
17
|
+
end
|
@@ -22,7 +22,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
22
22
|
gem "bridgetown", "~> <%= Bridgetown::VERSION %>"
|
23
23
|
|
24
24
|
# Uncomment to add file-based dynamic routing to your project:
|
25
|
-
# gem "bridgetown-routes", "~> <%= Bridgetown::VERSION %>"
|
25
|
+
# gem "bridgetown-routes", "~> <%= Bridgetown::VERSION %>"
|
26
26
|
|
27
27
|
# Uncomment to use the Inspectors API to manipulate the output
|
28
28
|
# of your HTML or XML resources:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html lang="<%= site.locale %>">
|
3
3
|
<head>
|
4
|
-
<%= render "head", metadata: site.metadata, title:
|
4
|
+
<%= render "head", metadata: site.metadata, title: data.title %>
|
5
5
|
</head>
|
6
|
-
<body class="<%=
|
6
|
+
<body class="<%= data.layout %> <%= data.page_class %>">
|
7
7
|
<%= render Shared::Navbar.new(metadata: site.metadata, resource: resource) %>
|
8
8
|
|
9
9
|
<main>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html lang="{{ site.locale }}">
|
3
3
|
<head>
|
4
|
-
{% render "head", metadata: site.metadata, title:
|
4
|
+
{% render "head", metadata: site.metadata, title: data.title %}
|
5
5
|
</head>
|
6
|
-
<body class="{{
|
6
|
+
<body class="{{ data.layout }} {{ data.page_class }}">
|
7
7
|
{% render "navbar", metadata: site.metadata, resource: resource %}
|
8
8
|
|
9
9
|
<main>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html lang="{%= site.locale %}">
|
3
3
|
<head>
|
4
|
-
{%@ "head", metadata: site.metadata, title:
|
4
|
+
{%@ "head", metadata: site.metadata, title: data.title %}
|
5
5
|
</head>
|
6
|
-
<body class="{{
|
6
|
+
<body class="{{ data.layout }} {{ data.page_class }}">
|
7
7
|
{%@ Shared::Navbar metadata: site.metadata, resource: resource %}
|
8
8
|
|
9
9
|
<main>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Bridgetown.configure do |config|
|
2
|
+
# You can configure aspects of your Bridgetown site here instead of using
|
3
|
+
# `bridgetown.config.yml`. For example:
|
4
|
+
#
|
5
|
+
# permalink "simple"
|
6
|
+
# timezone "America/Los_Angeles"
|
7
|
+
#
|
8
|
+
# You can also modify options on the configuration object directly, like so:
|
9
|
+
#
|
10
|
+
# config.autoload_paths << "models"
|
11
|
+
#
|
12
|
+
|
13
|
+
# You can use `init` to initialize various Bridgetown features or plugin gems.
|
14
|
+
# For example, you can use the Dotenv gem to load environment variables from
|
15
|
+
# `.env`. Just `bundle add dotenv` and then uncomment this:
|
16
|
+
#
|
17
|
+
# init :dotenv
|
18
|
+
#
|
19
|
+
|
20
|
+
# Uncomment to use Bridgetown SSR (aka dynamic rendering of content via Roda):
|
21
|
+
#
|
22
|
+
# init :ssr
|
23
|
+
#
|
24
|
+
|
25
|
+
# Uncomment to use file-based dynamic template routing via Roda (make sure you
|
26
|
+
# uncomment the gem dependency in your `Gemfile` as well):
|
27
|
+
#
|
28
|
+
# init :"bridgetown-routes"
|
29
|
+
#
|
30
|
+
|
31
|
+
# We also recommend that if you're using Roda routes you include this plugin
|
32
|
+
# so you can get a generated routes list in `.routes.json`. You can then run
|
33
|
+
# `bin/bridgetown roda:routes` to print the routes. (This will require you to
|
34
|
+
# comment your route blocks. See example in `server/routes/hello.rb.sample`.)
|
35
|
+
#
|
36
|
+
# only :server do
|
37
|
+
# init :parse_routes
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
|
41
|
+
# For more documentation on how to configure your site using this initializers file,
|
42
|
+
# visit: https://edge.bridgetownrb.com/documentation/configuration/initializers/
|
43
|
+
end
|
@@ -5,14 +5,8 @@
|
|
5
5
|
# Learn more at: http://roda.jeremyevans.net
|
6
6
|
|
7
7
|
class RodaApp < Bridgetown::Rack::Roda
|
8
|
-
#
|
9
|
-
|
10
|
-
# Uncomment to use Bridgetown SSR:
|
11
|
-
# plugin :bridgetown_ssr
|
12
|
-
|
13
|
-
# Uncomment to use file-based dynamic routing in your project (make sure you
|
14
|
-
# uncomment the gem dependency in your `Gemfile` as well):
|
15
|
-
# plugin :bridgetown_routes
|
8
|
+
# Some Roda configuration is handled in the `config/initializers.rb` file.
|
9
|
+
# But you can also add additional Roda configuration here if needed.
|
16
10
|
|
17
11
|
route do |r|
|
18
12
|
# Load Roda routes in server/routes (and src/_routes via `bridgetown-routes`)
|
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.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2022-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -344,8 +344,8 @@ dependencies:
|
|
344
344
|
- - "~>"
|
345
345
|
- !ruby/object:Gem::Version
|
346
346
|
version: '2.5'
|
347
|
-
description: Bridgetown is a
|
348
|
-
|
347
|
+
description: Bridgetown is a next-generation, progressive site generator & fullstack
|
348
|
+
framework, powered by Ruby
|
349
349
|
email: maintainers@bridgetownrb.com
|
350
350
|
executables:
|
351
351
|
- bridgetown
|
@@ -408,6 +408,7 @@ files:
|
|
408
408
|
- lib/bridgetown-core/concerns/site/writable.rb
|
409
409
|
- lib/bridgetown-core/concerns/transformable.rb
|
410
410
|
- lib/bridgetown-core/configuration.rb
|
411
|
+
- lib/bridgetown-core/configuration/configuration_dsl.rb
|
411
412
|
- lib/bridgetown-core/configurations/.keep
|
412
413
|
- lib/bridgetown-core/configurations/bt-postcss.rb
|
413
414
|
- lib/bridgetown-core/configurations/bt-postcss/postcss.config.js
|
@@ -455,7 +456,6 @@ files:
|
|
455
456
|
- lib/bridgetown-core/converters/markdown/kramdown_parser.rb
|
456
457
|
- lib/bridgetown-core/converters/ruby_templates.rb
|
457
458
|
- lib/bridgetown-core/converters/serbea_templates.rb
|
458
|
-
- lib/bridgetown-core/converters/smartypants.rb
|
459
459
|
- lib/bridgetown-core/core_ext/psych.rb
|
460
460
|
- lib/bridgetown-core/current.rb
|
461
461
|
- lib/bridgetown-core/deprecator.rb
|
@@ -519,6 +519,7 @@ files:
|
|
519
519
|
- lib/bridgetown-core/resource/transformer.rb
|
520
520
|
- lib/bridgetown-core/ruby_template_view.rb
|
521
521
|
- lib/bridgetown-core/site.rb
|
522
|
+
- lib/bridgetown-core/slot.rb
|
522
523
|
- lib/bridgetown-core/static_file.rb
|
523
524
|
- lib/bridgetown-core/tags/asset_path.rb
|
524
525
|
- lib/bridgetown-core/tags/class_map.rb
|
@@ -535,13 +536,18 @@ files:
|
|
535
536
|
- lib/bridgetown-core/utils.rb
|
536
537
|
- lib/bridgetown-core/utils/ansi.rb
|
537
538
|
- lib/bridgetown-core/utils/aux.rb
|
539
|
+
- lib/bridgetown-core/utils/initializers.rb
|
538
540
|
- lib/bridgetown-core/utils/loaders_manager.rb
|
539
541
|
- lib/bridgetown-core/utils/require_gems.rb
|
540
542
|
- lib/bridgetown-core/utils/ruby_exec.rb
|
541
543
|
- lib/bridgetown-core/utils/ruby_front_matter.rb
|
544
|
+
- lib/bridgetown-core/utils/smarty_pants_converter.rb
|
542
545
|
- lib/bridgetown-core/version.rb
|
543
546
|
- lib/bridgetown-core/watcher.rb
|
544
547
|
- lib/bridgetown-core/yaml_parser.rb
|
548
|
+
- lib/roda/plugins/bridgetown_boot.rb
|
549
|
+
- lib/roda/plugins/bridgetown_ssr.rb
|
550
|
+
- lib/roda/plugins/initializers.rb
|
545
551
|
- lib/site_template/.gitignore
|
546
552
|
- lib/site_template/Gemfile.erb
|
547
553
|
- lib/site_template/README.md
|
@@ -568,6 +574,7 @@ files:
|
|
568
574
|
- lib/site_template/TEMPLATES/serbea/_partials/_head.serb
|
569
575
|
- lib/site_template/bridgetown.config.yml
|
570
576
|
- lib/site_template/config.ru
|
577
|
+
- lib/site_template/config/initializers.rb
|
571
578
|
- lib/site_template/config/puma.rb
|
572
579
|
- lib/site_template/frontend/javascript/index.js.erb
|
573
580
|
- lib/site_template/frontend/styles/index.css
|
@@ -596,6 +603,7 @@ metadata:
|
|
596
603
|
bug_tracker_uri: https://github.com/bridgetownrb/bridgetown/issues
|
597
604
|
changelog_uri: https://github.com/bridgetownrb/bridgetown/releases
|
598
605
|
homepage_uri: https://www.bridgetownrb.com
|
606
|
+
rubygems_mfa_required: 'true'
|
599
607
|
post_install_message:
|
600
608
|
rdoc_options:
|
601
609
|
- "--charset=UTF-8"
|
@@ -608,13 +616,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
608
616
|
version: 2.7.0
|
609
617
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
610
618
|
requirements:
|
611
|
-
- - "
|
619
|
+
- - ">"
|
612
620
|
- !ruby/object:Gem::Version
|
613
|
-
version:
|
621
|
+
version: 1.3.1
|
614
622
|
requirements: []
|
615
623
|
rubygems_version: 3.1.4
|
616
624
|
signing_key:
|
617
625
|
specification_version: 4
|
618
|
-
summary: A
|
619
|
-
|
626
|
+
summary: A next-generation, progressive site generator & fullstack framework, powered
|
627
|
+
by Ruby
|
620
628
|
test_files: []
|