sylhare / Type-on-Strap

🎨 Simplistic, responsive jekyll based open source theme
https://sylhare.github.io/Type-on-Strap/
MIT License
805 stars 899 forks source link

Comment portfolio on _config.yml "Search broken" #441

Closed Vctrsnts closed 1 month ago

Vctrsnts commented 4 months ago

Describe the bug I Work with docker bretfisher/jekyll-serve:latest with this versions:

To Reproduce Steps to reproduce the behavior:

  1. I fork the theme and go to the _config.yml
  2. Comment with this # the lines about portfolio:
    #collections:
    #  portfolio:
    #    output: true
    #    permalink: /:collection/:name
  3. Run the theme and use the search option on firefox
  4. With F12 I watch this message:
    Uncaught Error: SimpleJekyllSearch --- failed to get JSON (/assets/data/search.liquid) 
    a http://192.6.0.40:4001/assets/js/vendor/simple-jekyll-search.min.js:6
    SimpleJekyllSearch http://192.6.0.40:4001/assets/js/vendor/simple-jekyll-search.min.js:6
    h http://192.6.0.40:4001/assets/js/vendor/simple-jekyll-search.min.js:6
    load http://192.6.0.40:4001/assets/js/vendor/simple-jekyll-search.min.js:6
    SimpleJekyllSearch http://192.6.0.40:4001/assets/js/vendor/simple-jekyll-search.min.js:6
    <anonymous> http://192.6.0.40:4001/search/:35
  5. If you not comment the lines of portfolio all work perfect
  6. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots github

Additional context Add any other context about the problem here.

sylhare commented 4 months ago

Ok I see where this is from, the JSON is created by looping through the collections. With no collection the JSON might get broken or the liquid template might be failing.

sylhare commented 1 month ago

A fix has been merged 👍