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

undefined method '[]' and undefined method 'gsub' issues #12

Open
justinmarsan opened this issue Mar 25, 2015 · 2 comments
Open

undefined method '[]' and undefined method 'gsub' issues #12

justinmarsan opened this issue Mar 25, 2015 · 2 comments

Comments

@justinmarsan
Copy link

After fighting with the plugin for a bit, I finally managed to make it work the way I wanted.

I believe the docs are un-clear and the experience could be improved when getting started, especially for non-ruby dev who can't really make sense of the errors...

The docs lead me to believe I didn't need anything in my config file, as long as I kept the default layout filename, didn't want slug or anything else. That wasn't the case, I got undefined method until I added that.

I then got a gsub method missing error because I tried to use the actual name of the category to test things instead of passing a variable to generate the link, that wouldn't work.

So if anyone is getting stuck too, here's what my config file looks like 👍

# Categories
category_archive:
  slugify: true
  path: /blog/category

And this is how I display the links for all of my categories 👍

<ul class="sidebar-categories">
    {% for cat in site.categories %}
    <li>{% categorylink cat[0] %}This is a link to foo{% endcategorylink %}</li>
    {% endfor %}
</ul>

Hope this helps and when someone has some time to make the readme clearer, it'd probably be nice too.

Thanks for the work either way, I'm glad I managed to make it work after all !

@erickpeirson
Copy link
Contributor

Thanks, this was helpful

@shigeya
Copy link
Owner

shigeya commented Oct 11, 2015

Thanks for feedback. I will update documentation as you suggested.
(sorry for late response - I couldn't manage to have time to review this last six months:< )

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

3 participants