Skip to content

Commit

Permalink
Merge branch 'main' into 1-3-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Mar 16, 2024
2 parents 16cd7d5 + fb14549 commit 0f18fb2
Show file tree
Hide file tree
Showing 56 changed files with 1,034 additions and 405 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
- Use global regex for Stimulus Configuration

## [1.3.2] - 2024-01-01

Expand Down Expand Up @@ -705,7 +706,7 @@ Final release of 0.21.0! See below for full changelog.
## 0.11.1 - 2020-04-24

* Add a git init step to `bridgetown new` command [#18](https://github.com/bridgetownrb/bridgetown/pull/18)
* Update sass-loader webpack config to support .sass [#14](https://github.com/bridgetownrb/bridgetown/pull/14) ([jaredmoody](https://github.com/jaredmoody))
* Update sass-loader webpack config to support .sass [#14](https://github.com/bridgetownrb/bridgetown/pull/14) ([jaredmoody](https://github.com/jaredmoody))
* Add customizable permalinks to Prototype Pages (aka `/path/to/:term/and/beyond`). Use hooks and in-memory caching to speed up Pagination. _Inspired by [use cases like this](https://annualbeta.com/blog/dynamic-social-sharing-images-with-eleventy/)_ [#12](https://github.com/bridgetownrb/bridgetown/pull/12)

## 0.11.0 - 2020-04-21
Expand Down
13 changes: 8 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PATH
listen (~> 3.0)
rake (>= 13.0)
roda (~> 3.46)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
serbea (~> 1.0)
thor (~> 1.1)
tilt (~> 2.0)
Expand Down Expand Up @@ -151,14 +151,17 @@ GEM
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
nokolexbor (0.5.2)
nokolexbor (0.5.3)
nokolexbor (0.5.3-arm64-darwin)
nokolexbor (0.5.3-x86_64-darwin)
nokolexbor (0.5.3-x86_64-linux)
parallel (1.24.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
public_suffix (5.0.4)
racc (1.7.3)
rack (3.0.8)
rack (3.0.9.1)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
Expand All @@ -173,7 +176,7 @@ GEM
rexml (3.2.6)
roda (3.75.0)
rack
rouge (3.30.0)
rouge (4.2.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand Down Expand Up @@ -249,7 +252,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
yard (0.9.34)
yard (0.9.36)
zeitwerk (2.6.12)

PLATFORMS
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ Bridgetown is built by:
|<a href="https://github.com/vvveebs">@vvveebs</a>|<a href="https://github.com/rickychilcott">@rickychilcott</a>|<a href="https://github.com/tommasongr">@tommasongr</a>|<a href="https://github.com/tombruijn">@tombruijn</a>|<a href="https://github.com/svoop">@svoop</a>|
|London, UK|Ohio, US|Amsterdam, The Netherlands|Milan, IT|Europe|

|<img src="https://avatars.githubusercontent.com/michaelherold?s=256" alt="michaelherold" width="128" />|<img src="https://avatars.githubusercontent.com/joemasilotti?s=256" alt="joemasilotti" width="128" />|<img src="https://avatars.githubusercontent.com/ikass?s=256" alt="ikass" width="128" />|<img src="https://avatars.githubusercontent.com/jw81?s=256" alt="jw81" width="128" />|
|:---:|:---:|:---:|:---:|
|<a href="https://github.com/michaelherold">@michaelherold</a>|<a href="https://github.com/joemasilotti">@joemasilotti</a>|<a href="https://github.com/Ikass">@ikass</a>|<a href="https://github.com/jw81">@jw81</a>|
|Omaha, NE|Portland, OR|Latvia|Kansas City, MO|
|<img src="https://avatars.githubusercontent.com/michaelherold?s=256" alt="michaelherold" width="128" />|<img src="https://avatars.githubusercontent.com/joemasilotti?s=256" alt="joemasilotti" width="128" />|<img src="https://avatars.githubusercontent.com/ikass?s=256" alt="ikass" width="128" />|<img src="https://avatars.githubusercontent.com/jw81?s=256" alt="jw81" width="128" />|<img src="https://avatars.githubusercontent.com/MSILycanthropy?s=256" alt="jw81" width="128" />
|:---:|:---:|:---:|:---:|:---:|
|<a href="https://github.com/michaelherold">@michaelherold</a>|<a href="https://github.com/joemasilotti">@joemasilotti</a>|<a href="https://github.com/Ikass">@ikass</a>|<a href="https://github.com/jw81">@jw81</a>|<a href="https://github.com/MSILycanthropy">@MSILycanthropy</a>|
|Omaha, NE|Portland, OR|Latvia|Kansas City, MO|Kansas City, MO|

|<img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=identicon&s=128&" alt="" width="128" />|
|:---:|
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-builder/lib/bridgetown-builder/dsl/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def resource
end

def add_resource(collection_name, path, &block) # rubocop:todo Metrics/AbcSize
data = Bridgetown::Utils::RubyFrontMatter.new(scope: self).tap do |fm|
data = Bridgetown::FrontMatter::RubyFrontMatter.new(scope: self).tap do |fm|
fm.define_singleton_method(:___) do |hsh|
hsh.each do |k, v|
fm.set k, v
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-core/bridgetown-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency("listen", "~> 3.0")
s.add_runtime_dependency("rake", ">= 13.0")
s.add_runtime_dependency("roda", "~> 3.46")
s.add_runtime_dependency("rouge", "~> 3.0")
s.add_runtime_dependency("rouge", [">= 3.0", "< 5.0"])
s.add_runtime_dependency("serbea", "~> 1.0")
s.add_runtime_dependency("thor", "~> 1.1")
s.add_runtime_dependency("tilt", "~> 2.0")
Expand Down
13 changes: 11 additions & 2 deletions bridgetown-core/lib/bridgetown-core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ module Bridgetown
autoload :EntryFilter, "bridgetown-core/entry_filter"
# TODO: we have too many errors! This is silly
autoload :Errors, "bridgetown-core/errors"
autoload :FrontmatterDefaults, "bridgetown-core/frontmatter_defaults"
autoload :FrontMatterImporter, "bridgetown-core/concerns/front_matter_importer"
autoload :FrontMatter, "bridgetown-core/front_matter"
autoload :GeneratedPage, "bridgetown-core/generated_page"
autoload :Hooks, "bridgetown-core/hooks"
autoload :Layout, "bridgetown-core/layout"
Expand All @@ -110,6 +109,16 @@ module Bridgetown
autoload :Watcher, "bridgetown-core/watcher"
autoload :YAMLParser, "bridgetown-core/yaml_parser"

FrontmatterDefaults = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(
"FrontmatterDefaults",
"Bridgetown::FrontMatter::Defaults"
)

FrontMatterImporter = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(
"FrontMatterImporter",
"Bridgetown::FrontMatter::Importer"
)

# extensions
require "bridgetown-core/commands/registrations"
require "bridgetown-core/plugin"
Expand Down
3 changes: 1 addition & 2 deletions bridgetown-core/lib/bridgetown-core/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def read

next if File.basename(file_path).starts_with?("_")

if label == "data" || Utils.has_yaml_header?(full_path) ||
Utils.has_rbfm_header?(full_path)
if label == "data" || FrontMatter::Loaders.front_matter?(full_path)
read_resource(full_path)
else
read_static_file(file_path, full_path)
Expand Down
12 changes: 4 additions & 8 deletions bridgetown-core/lib/bridgetown-core/commands/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

module Bridgetown
module ConsoleMethods
def site
Bridgetown::Current.site
end

def collections
site.collections
end

def reload!
Bridgetown.logger.info "Reloading site..."

site = Bridgetown::Current.site

I18n.reload! # make sure any locale files get read again
Bridgetown::Hooks.trigger :site, :pre_reload, site
Bridgetown::Hooks.clear_reloadable_hooks
Expand Down Expand Up @@ -99,6 +93,8 @@ def console # rubocop:disable Metrics
IRB::ExtendCommandBundle.include ConsoleMethods
IRB.setup(nil)
workspace = IRB::WorkSpace.new
workspace.main.define_singleton_method(:site) { Bridgetown::Current.site }
workspace.main.define_singleton_method(:collections) { site.collections }
irb = IRB::Irb.new(workspace)
IRB.conf[:IRB_RC]&.call(irb.context)
IRB.conf[:MAIN_CONTEXT] = irb.context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"$javascript/*": ["./frontend/javascript/*"],
"$components/*": ["./src/_components/*"]
}
},
},
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def defaults_reader
@defaults_reader ||= Bridgetown::DefaultsReader.new(self)
end

# Returns the current instance of {FrontmatterDefaults} or
# creates a new instance {FrontmatterDefaults} if it doesn't already exist.
# Returns the current instance of {FrontMatter::Defaults} or
# creates a new instance {FrontMatter::Defaults} if it doesn't already exist.
#
# @return [FrontmatterDefaults]
# Returns an instance of {FrontmatterDefaults}
# @return [FrontMatter::Defaults]
# Returns an instance of {FrontMatter::Defaults}
def frontmatter_defaults
@frontmatter_defaults ||= Bridgetown::FrontmatterDefaults.new(self)
@frontmatter_defaults ||= Bridgetown::FrontMatter::Defaults.new(self)
end

# Prefix a path or paths with the {#root_dir} directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bridgetown
class Configuration
class ConfigurationDSL < Bridgetown::Utils::RubyFrontMatter
class ConfigurationDSL < Bridgetown::FrontMatter::RubyFrontMatter
attr_reader :context

# @yieldself [ConfigurationDSL]
Expand Down
2 changes: 0 additions & 2 deletions bridgetown-core/lib/bridgetown-core/configurations/netlify.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

copy_file in_templates_dir("netlify.toml"), "netlify.toml"
copy_file in_templates_dir("netlify.sh"), "bin/netlify.sh"
`chmod a+x ./bin/netlify.sh`

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
[dev]
command = "bin/bridgetown dev"
targetPort = 4000
port = 8888
publish = "output"
autoLaunch = true
framework = "#custom"

[context.dev.build.environment]
NODE_ENV = "development"
BRIDGETOWN_ENV = "development"

[build]
command = "bin/bridgetown deploy && bin/netlify.sh"
command = "bin/bridgetown deploy"
publish = "output"

[build.environment]
Expand All @@ -19,14 +31,6 @@
Referrer-Policy = "no-referrer-when-downgrade"
Cache-Control = "public, max-age=604800, s-max-age=604800"

[[headers]]
for = "/"
[headers.values]
Link = [
"<CSS_PATH>; rel=preload; as=style",
"<JS_PATH>; rel=preload; as=script"
]

[[headers]]
for = "/*.(png|jpg|js|css|svg|woff|ttf|eot|ico|woff2)"
[headers.values]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
if (filename.includes("_controller.") || filename.includes("-controller.")) {
const identifier = filename.replace("./controllers/", "")
.replace(/[_-]controller\\..*$/, "")
.replace("_", "-")
.replace("/", "--")
.replace(/_/g, "-")
.replace(/\\//g, "--")
Stimulus.register(identifier, controller.default)
}
Expand Down
11 changes: 11 additions & 0 deletions bridgetown-core/lib/bridgetown-core/front_matter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Bridgetown
module FrontMatter
autoload :Defaults, "bridgetown-core/front_matter/defaults"
autoload :Importer, "bridgetown-core/front_matter/importer"
autoload :Loaders, "bridgetown-core/front_matter/loaders"
autoload :RubyDSL, "bridgetown-core/front_matter/ruby"
autoload :RubyFrontMatter, "bridgetown-core/front_matter/ruby"
end
end
Loading

0 comments on commit 0f18fb2

Please sign in to comment.