untra / polyglot

:abc: Multilingual and i18n support tool for Jekyll Blogs
https://polyglot.untra.io
MIT License
394 stars 58 forks source link

"target of repeat operator is not specified" #173

Closed youarehou closed 8 months ago

youarehou commented 1 year ago

Excited to try this plugin. Thanks for creating and maintaining it.

Working in a clone of the Chirpy theme for Jekyll. Added polyglot to _config.yml and gemfile, and installed 1.5.1. Able to serve up site locally (haven't created any translations yet) but seeing this error:

/usr/.gem/ruby/2.7.8/gems/jekyll-polyglot-1.5.1/lib/jekyll/polyglot/patches/jekyll/site.rb:193:inrelative_url_regex': target of repeat operator is not specified: /href=\"?\/((?:(?!.gem)(?!.gemspec)(?!tools)(?!README.md)(?!CHANGELOG.md)(?!LICENSE)(?!rollup.config.js)(?!node_modules)(?!package.json)(?!.sass-cache)(?!.jekyll-cache)(?!gemfiles)(?!Gemfile)(?!Gemfile.lock)(?!vendor\/bundle\/)(?!vendor\/cache\/)(?!vendor\/gems\/)(?!vendor\/ruby\/)(?!en\/)[^,'\"\s\/?\.]+\.?)(?:\/[^\]\[\)\(\"\'\s]*)?)\"/ (RegexpError)`

For what it's worth, I'm on MacOS 10.12.6 and Ruby 2.7.8.

ameaninglessname commented 1 year ago

You can test the regex above with this great website.

Then you can identify the string source like *.gemspec is coming from the exclude: section of _config.yml file.

Solution

remove these strings from _config.yml

  - "*.gem"
  - "*.gemspec"