Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front matter does not work on Ruby 3 as the fix is not live #29

Open
alanrme opened this issue Feb 15, 2023 · 2 comments
Open

Front matter does not work on Ruby 3 as the fix is not live #29

alanrme opened this issue Feb 15, 2023 · 2 comments

Comments

@alanrme
Copy link

alanrme commented Feb 15, 2023

Front matter menus display an error when used (wrong number of arguments (given 2, expected 1) (ArgumentError))
This fix in pull request #23 is not present when the plugin is downloaded through both bundle and gem. Once the file is updated manually the plugin functions as normal.

To reproduce

---
layout: default
title: Exploits
menus:
    header:
        identifier: exploits
---

Logs

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:190:in `_fill_front_matter_menu': wrong number of arguments (given 2, expected 1) (ArgumentError)
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:130:in `block in _front_matter_menu'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:110:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:110:in `_front_matter_menu'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:69:in `block (2 levels) in _page_menus'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:68:in `map'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:68:in `block in _page_menus'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:67:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:67:in `each_with_object'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:67:in `_page_menus'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:18:in `menus'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb:26:in `to_liquid_drop'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus/hook.rb:14:in `block in <top (required)>'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/hooks.rb:103:in `block in trigger'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/hooks.rb:102:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/hooks.rb:102:in `trigger'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:208:in `render'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/site.rb:80:in `process'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:28:in `process_site'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/build.rb:65:in `build'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/build.rb:36:in `process'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby31-x64/bin/jekyll:25:in `load'
        from C:/Ruby31-x64/bin/jekyll:25:in `<main>'

Solution

Manually replacing C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-menus-0.6.1/lib/jekyll/menus.rb with the updated file in pull request #23

@alanrme
Copy link
Author

alanrme commented Feb 15, 2023

It should be noted that using gem "jekyll-menus", :git => "https://github.com/forestryio/jekyll-menus.git" in my gemfile has resolved this issue, even on GitHub pages. This should be added to the documentation if the changes cannot be made live.

@ybressler
Copy link

ybressler commented Apr 11, 2024

It should be noted that using gem "jekyll-menus", :git => "https://github.com/forestryio/jekyll-menus.git" in my gemfile has resolved this issue, even on GitHub pages. This should be added to the documentation if the changes cannot be made live.

I tried making this change, my site now builds correctly, but the menu is no longer being generated. How are you referencing jekyll-menus in your config?

UPDATE:

Need to place the gem in the plugins section of the config file, like so:

source 'https://rubygems.org'
gem 'jekyll'
gem 'rdiscount'

group :jekyll_plugins do
  gem "jekyll-remote-theme"
  gem "github-pages"
  gem "jekyll-menus", :git => "https://github.com/forestryio/jekyll-menus.git"  # <---- IT GOES HERE
  gem "jekyll-relative-links"
  gem "jekyll-github-metadata"
end

gem "webrick", "~> 1.8"
                                                                                # <---- NOT DOWN HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants