Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

site.posts collection is empty as soon as the plugin is activated #105

Open
andreamoro opened this issue Sep 17, 2017 · 5 comments
Open

Comments

@andreamoro
Copy link

Not sure what I need to do to return the posts collection. I left the files in the _posts folder as they were before activating the plugin.
Is there a generic example I can look into to start building a brand new site?

Also, is there a chance to use the language code within the file name? Or - as far as I understand -
language can only be controlled via the front matter?

Thanks

@alexandre1985
Copy link

alexandre1985 commented Jan 27, 2018

My site.posts.size also returns always 0 as soon as I activate the plugin.
Is this a bug?
Or are the posts localized by language and there is a different way to use site.posts?
My jekyll is jekyll 3.6.2 and the site.posts.size where not zero before I activated the plugin

@alexandre1985
Copy link

I found the solution @andreamoro .
From what I have seen in the code, you can't have general posts for all languages; all posts are localized by language.
So, for you to have posts in your English language, you should put them in: _i18n/en/_posts/ directory.
That is it. Its missing some documentation on that @Anthony-Gaudino .

@DenisLug
Copy link

Thank you alexandre. I have searched long for the reason why no posts are appearing. The readme doesn't contains any hint about creating a _posts directory in the _i18n/[LANG] folders.

@alexanmtz
Copy link

After several configs and trying to make this work the solution from @alexandre1985 works for me, placing the posts inside _i18n/en/_posts/

@rraallvv
Copy link

rraallvv commented Aug 6, 2018

Does anyone know if this plugin supports having a common _posts folder. With a different _posts folders for each language it seems to me that there is going to be a lot of duplicate HTML code. It would be better to have different lists of localized strings (one per language) but only a single page for each post in HTML shared among languages. At least that's how I've been handing localization in native apps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants