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

Fix to collections.js for site.collections change in Jekyll 3 #20

Open
heacu opened this issue Sep 9, 2017 · 1 comment
Open

Fix to collections.js for site.collections change in Jekyll 3 #20

heacu opened this issue Sep 9, 2017 · 1 comment

Comments

@heacu
Copy link

heacu commented Sep 9, 2017

Jekyll couldn't build my site. I tracked the problem down to lib/local/collections.js, and changed it like so:

var Collections = (function(window, undefined) {
    /*
     * Listing of all the collections and documents. Generated
     * automatically by Jekyll and used e.g for the auto-linking
     * feature. Don't edit this file unless you are sure what you are
     * doing.
     */
    var listing = {
        {% for i in site.collections %}{% assign c = i %}
        "{{ c.label }}": [{% for d in c.docs %}
            {
                "title": "{{ d.title }}",
                "url":   "{{ site.baseurl }}{{ d.url }}",
            },{% endfor %}
        ],
       {% endfor %}
    };

    return {
        listing: listing,
    };
})(window);

I made this change because site.collections has changed in Jekyll 3 http://jekyllrb.com/docs/upgrading/2-to-3/#sitecollections-has-changed. My site builds again now so the change seems to have worked.

heacu pushed a commit to tibetan-nlp/annotation-docs that referenced this issue Sep 9, 2017
@spyysalo
Copy link
Owner

spyysalo commented Dec 4, 2017

@torma : thanks for noting this! The compatibility hack for #16 appears to have ceased to work somewhere between jekyll 3.3.1 and 3.6.2. The error for 3.6.2 is

Liquid Exception: 1 is not a symbol nor a string in lib/local/collections.js
jekyll 3.6.2 | Error:  1 is not a symbol nor a string

I'll adopt your solution if I can't figure out a backward-compatible reformulation.

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

2 participants