Can I have non-html / md files in the render?

I have a collection writing

on my Jekyll site and I have it output

set to true because I want all files to be displayed .md

and .html

displayed. However, there are some files .js

and .css

that I would like Jekyll to just work as usual.

I am getting this error

undefined method `data' for #<Jekyll::StaticFile:0x00000104d8bb70>

      

and I believe because Jekyll is trying to parse js / css files.

Is it possible for static files to be loaded properly into my collections?


Update Here's the complete trace:

Configuration file: project/_config.yml
            Source: project
       Destination: project/_site
      Generating...
Unable to find a valid configuration: sass_path=project/_compass
~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:38:in `has_alt_urls?': undefined method `data' for #<Jekyll::StaticFile:0x000001035f8f58> (NoMethodError)
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:14:in `block in generate_alt_urls'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:13:in `each'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:13:in `generate_alt_urls'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:9:in `generate'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/site.rb:251:in `block in generate'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/site.rb:250:in `each'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/site.rb:250:in `generate'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/site.rb:45:in `process'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/command.rb:28:in `process_site'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/commands/build.rb:55:in `build'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/commands/build.rb:33:in `process'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/lib/jekyll/commands/build.rb:17:in `block (2 levels) in init_with_program'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `call'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `block in execute'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `each'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary/command.rb:220:in `execute'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary/program.rb:35:in `go'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.4/lib/mercenary.rb:22:in `program'
        from ~/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/jekyll-2.4.0/bin/jekyll:18:in `<top (required)>'
        from ~/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `load'
        from ~/.rvm/gems/ruby-2.1.1/bin/jekyll:23:in `<main>'
        from ~/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
        from ~/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

      

+3


source to share


1 answer


You should normally use static files in the collection, but there is a jekyll-redirect 0.6.2 bug ( here ).

Workarounds

1.use the Github page config

If you plan on serving your site from Github pages, you need to add Gemfile

with

source 'https://rubygems.org'
gem 'github-pages'

      



Then do a bundle update

. This will fix the problem, since Jekyll-redirect 0.3.1 does not attempt to redirect collections.

2. Move your static files

Extract your static files from the collection folder to avoid errors with static file collections.

3. Remove the redirect plugin

If you don't need it, or just need it for one or two pages, remove it from the Gemfile and create a redirect page to copy the redirect pages.

+4


source







All Articles