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

Can't filter Pages by language #19

Open
uaqben opened this issue Aug 1, 2015 · 2 comments
Open

Can't filter Pages by language #19

uaqben opened this issue Aug 1, 2015 · 2 comments

Comments

@uaqben
Copy link

uaqben commented Aug 1, 2015

I've tried quite a few approaches, but I just can't figure this thing out.

Posts for me work fine.

But I can't figure a way to scope only the current language's Pages that I want displayed in the site's navigation bar.

Any pointers/suggestions?

I take it the following is not implemented, correct?

{% for page in site.pages_by_language.en %}

I've tried using set_lang, but didn't work either, I get an error from Jekyll/Liquid

 {% set_lang en %}
 {% for page in site.pages %}
 {% if page.title %}
     <li class="page-scroll">
         <a href="{{ lang }}{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a>
     </li>
 {% endif %}
 {% endfor %}
 {% endset_lang %}

Liquid Exception: can't clone NilClass

@imathis
Copy link
Member

imathis commented Aug 17, 2015

You're correct there is no pages_by_language var. The reason I provide this feature for posts, is that it's a very common patter to have post indexes, rss feeds and archive pages which would all need to filter the post loop for different languages. In most cases it doesn't make sense to loop through all site pages. What is your use case for filtering a loop of all pages?

@uaqben
Copy link
Author

uaqben commented Aug 28, 2015

Hi @imathis - just came back from 2 week break.

My use case is the following - I wish to use Octopress to host a "full" multilingual site, which will include a blog/news section, as well as "static/normal" pages. Therefore, not only do I wish to be able to translate the news/blog posts, but also every single page on the site, such as: Services or Products, About, Contact, etc.

BTW. I realized that my pull request was faulty - as I manually redid the changes from memory, and forgot to edit a line - I have just fixed that and, as per info I found on stackoverflow on how to modify a pull request, I will resubmit it. Pls excuse the hassle - on the other hand it is a good learning experience for me ;)

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