bridgetown-core 1.0.0.beta3 → 1.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -1
- data/lib/bridgetown-core/collection.rb +37 -20
- data/lib/bridgetown-core/commands/concerns/actions.rb +3 -2
- data/lib/bridgetown-core/commands/configure.rb +1 -1
- data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +20 -16
- data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +95 -12
- data/lib/bridgetown-core/commands/new.rb +10 -9
- data/lib/bridgetown-core/commands/plugins.rb +2 -0
- 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 +13 -7
- 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/configuration.rb +2 -0
- 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/gh-pages/gh-pages.yml +33 -0
- data/lib/bridgetown-core/configurations/gh-pages.rb +16 -0
- 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/converters/markdown/kramdown_parser.rb +1 -1
- 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 +1 -2
- data/lib/bridgetown-core/plugin.rb +6 -37
- data/lib/bridgetown-core/plugin_manager.rb +3 -2
- data/lib/bridgetown-core/rack/boot.rb +5 -0
- data/lib/bridgetown-core/rack/logger.rb +14 -4
- data/lib/bridgetown-core/rack/roda.rb +102 -10
- data/lib/bridgetown-core/rack/routes.rb +87 -6
- data/lib/bridgetown-core/resource/base.rb +4 -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/utils/aux.rb +2 -1
- data/lib/bridgetown-core/utils/require_gems.rb +3 -6
- data/lib/bridgetown-core/utils.rb +25 -12
- data/lib/bridgetown-core/version.rb +2 -2
- data/lib/bridgetown-core/watcher.rb +19 -6
- data/lib/bridgetown-core.rb +8 -2
- data/lib/site_template/Gemfile.erb +1 -1
- data/lib/site_template/README.md +2 -2
- data/lib/site_template/TEMPLATES/erb/_components/shared/navbar.erb +4 -4
- data/lib/site_template/TEMPLATES/liquid/_components/navbar.liquid +4 -4
- data/lib/site_template/TEMPLATES/serbea/_components/shared/navbar.serb +4 -4
- data/lib/site_template/bridgetown.config.yml +10 -3
- 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 -3
- data/lib/bridgetown-core/publisher.rb +0 -29
@@ -7,6 +7,7 @@ module Bridgetown
|
|
7
7
|
include Bridgetown::Publishable
|
8
8
|
include Bridgetown::LayoutPlaceable
|
9
9
|
include Bridgetown::LiquidRenderable
|
10
|
+
include Bridgetown::Localizable
|
10
11
|
|
11
12
|
# @return [HashWithDotAccess::Hash]
|
12
13
|
attr_reader :data
|
@@ -210,10 +211,7 @@ module Bridgetown
|
|
210
211
|
def requires_destination?
|
211
212
|
collection.write? && data.config&.output != false
|
212
213
|
end
|
213
|
-
|
214
|
-
def write?
|
215
|
-
requires_destination? && site.publisher.publish?(self)
|
216
|
-
end
|
214
|
+
alias_method :write?, :requires_destination?
|
217
215
|
|
218
216
|
# Write the generated Document file to the destination directory.
|
219
217
|
#
|
@@ -295,7 +293,7 @@ module Bridgetown
|
|
295
293
|
|
296
294
|
private
|
297
295
|
|
298
|
-
def ensure_default_data
|
296
|
+
def ensure_default_data
|
299
297
|
determine_locale
|
300
298
|
|
301
299
|
slug = if matches = relative_path.to_s.match(DATE_FILENAME_MATCHER) # rubocop:disable Lint/AssignmentInCondition
|
@@ -305,7 +303,7 @@ module Bridgetown
|
|
305
303
|
basename_without_ext
|
306
304
|
end
|
307
305
|
|
308
|
-
|
306
|
+
Bridgetown::Utils.chomp_locale_suffix!(slug, data.locale)
|
309
307
|
|
310
308
|
data.slug ||= slug
|
311
309
|
data.title ||= Bridgetown::Utils.titleize_slug(slug)
|
@@ -12,6 +12,7 @@ module Bridgetown
|
|
12
12
|
# @param resource [Bridgetown::Resource::Base]
|
13
13
|
def initialize(resource)
|
14
14
|
@resource = resource
|
15
|
+
warn_on_rails_style_extension
|
15
16
|
@output_ext = resource.transformer.final_ext
|
16
17
|
end
|
17
18
|
|
@@ -46,6 +47,23 @@ module Bridgetown
|
|
46
47
|
Bridgetown.logger.debug "Writing:", path
|
47
48
|
File.write(path, output, mode: "wb")
|
48
49
|
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def warn_on_rails_style_extension
|
54
|
+
return unless resource.relative_path.fnmatch?("*.{html,json,js}.*", File::FNM_EXTGLOB)
|
55
|
+
|
56
|
+
Bridgetown.logger.warn("Uh oh!", "You're using a Rails-style filename extension in:")
|
57
|
+
Bridgetown.logger.warn("", resource.relative_path)
|
58
|
+
Bridgetown.logger.warn(
|
59
|
+
"", "Instead, you can use either the desired output file extension or set a permalink."
|
60
|
+
)
|
61
|
+
Bridgetown.logger.warn(
|
62
|
+
"For more info:",
|
63
|
+
"https://www.bridgetownrb.com/docs/template-engines/erb-and-beyond#extensions-and-permalinks"
|
64
|
+
)
|
65
|
+
Bridgetown.logger.warn("")
|
66
|
+
end
|
49
67
|
end
|
50
68
|
end
|
51
69
|
end
|
@@ -113,9 +113,8 @@ module Bridgetown
|
|
113
113
|
if resource.site.config["collections_dir"].present?
|
114
114
|
path.delete_prefix! "#{resource.site.config["collections_dir"]}/"
|
115
115
|
end
|
116
|
-
|
117
|
-
|
118
|
-
end
|
116
|
+
|
117
|
+
Bridgetown::Utils.chomp_locale_suffix!(path, resource.data.locale)
|
119
118
|
end,
|
120
119
|
}
|
121
120
|
end
|
@@ -137,7 +136,10 @@ module Bridgetown
|
|
137
136
|
|
138
137
|
# @param resource [Bridgetown::Resource::Base]
|
139
138
|
register_placeholder :locale, ->(resource) do
|
140
|
-
|
139
|
+
if !resource.site.config.prefix_default_locale &&
|
140
|
+
resource.data.locale&.to_sym == resource.site.config.default_locale
|
141
|
+
next nil
|
142
|
+
end
|
141
143
|
|
142
144
|
locale_data = resource.data.locale&.to_sym
|
143
145
|
resource.site.config.available_locales.include?(locale_data) ? locale_data.to_s : nil
|
@@ -68,7 +68,7 @@ module Bridgetown
|
|
68
68
|
# @return [String]
|
69
69
|
def kind_of_relation_for_type(type)
|
70
70
|
relation_schema&.each do |relation_type, collections|
|
71
|
-
collections = Array(collections).
|
71
|
+
collections = Array(collections).then do |collections_arr|
|
72
72
|
collections_arr +
|
73
73
|
collections_arr.map { |item| ActiveSupport::Inflector.pluralize(item) }
|
74
74
|
end.flatten.uniq
|
@@ -20,7 +20,8 @@ module Bridgetown
|
|
20
20
|
def self.run_process(name, color, cmd)
|
21
21
|
Thread.new do
|
22
22
|
rd, wr = IO.pipe("BINARY")
|
23
|
-
pid = Process.spawn(
|
23
|
+
pid = Process.spawn({ "BRIDGETOWN_NO_BUNDLER_REQUIRE" => nil },
|
24
|
+
cmd, out: wr, err: wr, pgroup: true)
|
24
25
|
@mutex.synchronize do
|
25
26
|
add_pid pid
|
26
27
|
end
|
@@ -41,15 +41,12 @@ module Bridgetown
|
|
41
41
|
require name
|
42
42
|
rescue LoadError => e
|
43
43
|
Bridgetown.logger.error "Dependency Error:", <<~MSG
|
44
|
-
|
45
|
-
|
44
|
+
Oops! It looks like you don't have #{name} or one of its dependencies installed.
|
45
|
+
Please double-check you've added #{name} to your Gemfile.
|
46
46
|
|
47
|
-
If you'
|
48
|
-
gem in your Gemfile as well.
|
47
|
+
If you're stuck, you can find help at https://www.bridgetownrb.com/community
|
49
48
|
|
50
49
|
The full error message from Ruby is: '#{e.message}'
|
51
|
-
|
52
|
-
If you run into trouble, you can find helpful resources at https://www.bridgetownrb.com/docs/community/
|
53
50
|
MSG
|
54
51
|
raise Bridgetown::Errors::MissingDependencyException, name
|
55
52
|
end
|
@@ -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
|
@@ -457,7 +460,7 @@ module Bridgetown
|
|
457
460
|
code = <<~JAVASCRIPT
|
458
461
|
let lastmod = 0
|
459
462
|
function startReloadConnection() {
|
460
|
-
const evtSource = new EventSource("/_bridgetown/live_reload")
|
463
|
+
const evtSource = new EventSource("#{site.base_path(strip_slash_only: true)}/_bridgetown/live_reload")
|
461
464
|
evtSource.onmessage = event => {
|
462
465
|
if (event.data == "reloaded!") {
|
463
466
|
location.reload()
|
@@ -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}
|
@@ -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
|
|
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
|
@@ -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
|
@@ -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
|