Hello,
With the blog extension I’m trying to have the page_articles
helper to list of articles to display on this page given a specified language, it would be like blog.local_articles
but with pagination. Here is the page_articles
and local_articles
methods for reference
def page_articles(blog_name=nil)
meta = current_resource.metadata
limit = meta[:page]["per_page"]
# "articles" local variable is populated by Calendar and Tag page generators
# If it's not set then use the complete list of articles
articles = meta[:locals]["articles"] || blog(blog_name).articles
limit ? articles.first(limit) : articles
end
def local_articles(lang=nil)
lang ||= I18n.locale
lang = lang.to_sym if lang.kind_of? String
articles.select {|article| article.lang == lang }
end
I tried to mix the two but without success.
Thank you for your help