bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.13k stars 114 forks source link

Bridgetown 1.2.0.beta3 has problems with plugins (feed, svg inliner, etc.) #639

Closed posiczko closed 1 year ago

posiczko commented 1 year ago

Plugins in BT version 1.2.0.beta3 seem to be broken, i.e. after they are added, the subsequent runs of bridgetown generate exceptions.

Bridgetown Version: 1.2.0.beta3

To Reproduce

❯ bridgetown new bt-bug-project-1.1.0 -t erb
[...]
❯ cd bt-bug-project-1.1.0
❯ bundle add bridgetown-feed -g bridgetown_plugins
[...]
❯ echo '<%= feed_meta %>' >> src/_partials/_head.erb
❯ ./bin/bt build
          Starting: Bridgetown v1.2.0.beta3 (codename "Bonny Slope")
       Environment: development
            Source: /Users/pablo/Projects/bt-bug-project-1.1.0/src
       Destination: /Users/pablo/Projects/bt-bug-project-1.1.0/output
    Custom Plugins: /Users/pablo/Projects/bt-bug-project-1.1.0/plugins
        Generating…
        Pagination: disabled. Enable in site config with pagination:\n enabled: true
           esbuild: There was an error parsing your esbuild manifest file. Please check your esbuild manifest file for any errors.
  Conversion error: Bridgetown::Converters::ERBTemplates encountered an error while converting `_posts/2022-10-11-welcome-to-bridgetown.md'
  Exception raised: NameError
undefined local variable or method `feed_meta' for #<Bridgetown::ERBView layout=default resource=_posts/2022-10-11-welcome-to-bridgetown.md>
                 1: /Users/pablo/.gem/ruby/3.1.2/gems/bridgetown-core-1.2.0.beta3/lib/bridgetown-core/ruby_template_view.rb:72:in `method_missing'
                 2: /Users/pablo/Projects/bt-bug-project-1.1.0/src/_partials/_head.erb:12:in `__tilt_3860'
                 3: /Users/pablo/.gem/ruby/3.1.2/gems/tilt-2.0.11/lib/tilt/template.rb:181:in `call'
                 4: /Users/pablo/.gem/ruby/3.1.2/gems/tilt-2.0.11/lib/tilt/template.rb:181:in `evaluate'
                 5: /Users/pablo/.gem/ruby/3.1.2/gems/tilt-2.0.11/lib/tilt/template.rb:109:in `render'
         Backtrace: Use the --trace option for complete information.

Repo of the above is available

Current behavior Running build/start with feed and other plugin friends results in an NameError exception. Perhaps zeitwerk load paths changed/are overwritten?

Expected behavior Plugins should load.

Screenshots

Computing environment (please complete the following information):

jaredcwhite commented 1 year ago

There's a new initialization system that's in place now going forward. Old sites should still work assuming they don't upgrade the plugin gem versions. See https://edge.bridgetownrb.com/docs/installation/upgrade