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

redirect from tries to acces front matter on static files #47

Closed
djacquel opened this issue Oct 10, 2014 · 4 comments · Fixed by #56
Closed

redirect from tries to acces front matter on static files #47

djacquel opened this issue Oct 10, 2014 · 4 comments · Fixed by #56
Assignees

Comments

@djacquel
Copy link

Investigating on this stackoverflow question I've found that redirect from tries to acces front matter on static files.

Reproduce :

  • new jekyll site (2.4)
  • a collection with static files like .js or .css
  • jekyll-redirect
  • jekyll build

Error : /var/lib/gems/1.9.1/gems/jekyll-redirect-from-0.6.2/lib/jekyll-redirect-from/redirector.rb:38:inhas_alt_urls?': undefined method data' for #<Jekyll::StaticFile:0x00000001baa4e0> (NoMethodError)

The Redirector:generate method at generate_alt_urls(site, site.docs_to_write) receive both collection files + static files, then method Redirector:has_alt_urls tries to access the unexisting method on statik file.

This is not reproduced in gh-page configuration as the generate_alt_urls(site, site.docs_to_write) doesn't exist.

@benbalter
Copy link
Contributor

I am able to reproduce this as well.

@parkr
Copy link
Member

parkr commented Oct 10, 2014

So we should check that it's Convertible or a Document. Thanks for the bug report!

@parkr parkr self-assigned this Oct 10, 2014
@astanush
Copy link

astanush commented Dec 4, 2014

I'm having a similar error, also using collections on our project. My steps:

  1. Installed manually using gem install jekyll-redirect-from
  2. Added the gem declaration to config.yml

Running jekyll serve produces the following:

$ jekyll serve
Configuration file: /Users/aaron/Projects/styleguides-io/_config.yml
            Source: /Users/aaron/Projects/styleguides-io
       Destination: /Users/aaron/Projects/styleguides-io/_site
      Generating...
jekyll 2.5.2 | Error:  undefined method `data' for #<Jekyll::StaticFile:0x007ffc4b3ae0b8>

@nashbridges
Copy link

Another example with image and pdf files located withing collections directory, which gives the same error if using jekyll-redirect-from

@parkr parkr closed this as completed in #56 Mar 17, 2015
stefanw added a commit to okfde/old.okfn.de that referenced this issue Apr 14, 2015
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants