New latest post list aproach.#23
Conversation
Like news list, de post can be listed with a loop.
The ideal is check with post is for list on idex with this code:
{% for post in site.posts limit:latest-articles-pages %}
{% if post.index %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
|
you are right, the latest posts can be listed with your code, but the list of articles is not the latest posts, it is limited to posts in the articles folder. |
|
Well, we can use Jekyll in our favor in this topic, creating a category "articles" instead of a separate folder. And use the permalink directive to lock the link. What do you think? |
yes, the articles are already in the "articles" category, if you know how to select the latest n, you can experiment and suggest a solution. |
|
First of all you need to move them from the /pages/articles folder to /_post/article and set the "article" category to be the first in the list, or define a property in yaml header to identify this post diferently. . I'll do it here and put it on the Branch and I'll send it to you to havaliar when you can. |
hmmm... this makes them blog posts, and I would not do it, then we have to take special measures for them not to appear in the list of posts. we need a method to enumerate pages tagged with the article category, not blog posts. one possible solution would be a custom liquid tag, implemented in a ruby plug-in, similar to the ones already in use. but, considering there will be very few articles in the site, I doubt it is worth implementing. |
|
only a parameter like and a if on list blog.post for not list article == true and in article list list article == true I can care of this. |
exactly this |
|
only in lists of posts, no? |
|
We can take advantage of the layout parameter to use a layout with name article, when it is used, it adopts article behavior and is only list in their places. If it's a post layout, list it as a plog post. or And the article layout will be an extension of the page layout. |
|
for page work fine, is need put the parameter: |
|
I'm no longer able to follow you. please keep in mind that articles are pages, not posts, and should not interfere with posts in any way. |
|
I understand your point of view, I am considering just that. I'll give you an example, if it is not in the format that you think is appropriate, it's like an experiment. I'll release this branch with the example in a moment. The advantage will be automation simply by creating new articles and they will be listed in the right place. And in the future they can be translated and automatically listed when the site consolidates the translations. |
|
@ilg-ul Thanks for the opportunity to contribute. |
|
I checked your patches. I don't know where the flags are displayed, but please use the British flag, not the US one, since my text uses British English. as for moving articles to posts, I don't understand why we should do it. generally better submit separate requests for separate issues, to increase the chance of merging them. |
|
I removed the flags since they will not be used now. I'll be looking for better flags that have the same format for more languages if other translators emerge. I justified in the new commit the reason that I see as being appropriate in this change. I see the articles as a dynamic collection that tends to grow, so the use of posts is better and facilitates your listing and automatic referrals. And I see as a good practice the file lists adopt the post as a template, being categorized and identified by the chosen layout. This gives great possibilities, even for use for example in the User Manual that can be better adapted if in the future do not opt for a tool like GitBook. |
5871989 to
1031cea
Compare
The advantage of this approach is the automatic listing on the respective page when adding new articles. In using the previous model you had to manually add the list. Articles that were previously treated as pages are now treated as post, to differentiate them, the "post" and "articles" layout should be used respectively. The old folder "/ page / articles" now only contains the file that generates an index for listing articles published with the layout of the same name. The files that were there were moved to the folder "_post / articles" which are now adjusted for use in this format of posts but with the aforementioned remarks. To prevent articles from being listed in the default paigning and on the / blog / (old / news /) page, they must be marked with the hidden parameter that is observed by the pager to prevent publications that have it as true non-matching. All other posts should be made as default using the "post" layout. The files that were in the folder "_post / articles" were moved to "_post / news" and had the "article" category removed to be used only in posts that fall into this category. The file that generates the index page of the blog is now in / pages / blog to keep the same pattern of page creation. An algorithm has been added that prevents the news frame from being displayed when displaying the post listings on the link / blog /. The parameters in the _config.yml file that change the number of posts (news) listed have been changed so that you can group by layout used. Layout articles were created which is nothing more than a default wrapper. Also added were two icons with flags of the current languages for future use and other small changes.
1031cea to
c18b64f
Compare
|
I will make a new branch set for each suggestion. |
What/why?
New latest post list aproach.
Like news list, de post can be listed with a loop.
The ideal is check with post is for list on idex with this code: