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

4.0.2 regression bug when specifying the blog in the front-matter #365

Open
andreamoro opened this issue Sep 14, 2018 · 7 comments
Open
Labels

Comments

@andreamoro
Copy link

andreamoro commented Sep 14, 2018

Expected behaviour

With multiple blogs declared in the configuration file and the i18n setup to support multiple languages, once declared a specific blog instance in the front-matter of a local variant, the page_articles collection should return the the list of articles beloning to that particular blog.

Actual behaviour

Starting from version 4.0.2 this behaviour is somehow compromised and using the second language file to access blog content returns an empty collection.

Steps to reproduce the problem

The i18N settings in the config.rb
activate :i18n, :mount_at_root => false, :templates_dir => "content", :locales => [:en, :it]

The blog setup. The one below is for the English site. The Italian language is exactly the same, with the excetption of the output path, page_link, and tag_template .

activate :blog do |blogen|
  blogen.name = "blogen";
  blogen.prefix = 'en/blog'
  blogen.permalink = "{category}/:permalink"
  blogen.layout = "Blog-inner"
  blogen.preserve_locale = true

  blogen.summary_separator = /(READMORE)/
  blogen.summary_length = 350
  blogen.generate_day_pages = false
  blogen.generate_month_pages = false
  blogen.generate_year_pages = false
  blogen.paginate = true
  blogen.per_page = 3
  blogen.page_link = "page-{num}"

  blogen.taglink = "/{tag}/index.html"
  blogen.tag_template = "content/blog_tag.en.html"
end

FIle structure in my content directory looks like this
2018-08-04-xxxxxx.it.html.markdown.erb
2018-08-04-xxxxxx.en.html.markdown.erb

Note: the above configuration, with 4.0.2 and a specific "tag" works fine.
And the strange thing is that front matters are pretty much similar, nothing that will impact on the way how the blog works.

blog_tag.en.html.erb front matter and content
the it version is exactly the same, with the difference of the blog being blogit

---
layout: Blog
cssLayout: blog
blog: blogen
pageable: true
sitemap: false
---
<%
	# Get the category name from the first item in the array
	@category = page_articles[0].data.tags
%>
<%= partial("partials/blog-core") %>

blog.en.html.erb front matter and content
the it version is exactly the same, with the difference of the blog being blogit

---
layout: Blog
cssLayout: blog
author: myname
blog: blogen
pageable: true
title: blogPageDefaultHeading
description: blogPageDefaultDescr
---
<%= partial("partials/blog-core") %>

As you can see the file used to render the content is exactly the same. If you wonder about that @category variable, that is used just to print out a value for aesthetic purposes. In fact, as you may know, the selection of the tags happens internally based of the tag written in the front matter of each article.

Additional information

  • Ruby version: 2.5
  • Middleman version: 2.5.0p0
  • Middleman Blog version: 4.0.2
  • OS version: 10.13.6
@andreamoro
Copy link
Author

andreamoro commented Sep 14, 2018

Ok, so apparently the problem lays down with the pagination module. But that's where I can arrive.
No experience to get my hands into the middleman code to fix this.

Anybody that can look into it? @iwarner @mrtndwrd

@mrtndwrd
Copy link

I have no experience with the pagination module either. Did you make an issue in the Middleman repo?

What about the workaround I proposed in this other issue? Would that help your purpose?

@andreamoro
Copy link
Author

Was looking into this this morning, after many months me being not able to touch a line for my site.

Not sure what the outcome will be, but I'm not fancy in moving my content. I've fear to break something else.

@andreamoro
Copy link
Author

Actually have not reported on the middleman gitbìhub. Not sure the pagination module has a specific git @maartenvg.

@andreamoro
Copy link
Author

@tdreyno is there any chance somebody can investigate on this. This is happening also on the 4.0.3 version.

@tdreyno
Copy link
Member

tdreyno commented Feb 10, 2019

Thanks for pinging me @andreamoro, I don't subscribe to this repo since it's normally maintained by others.

I'll take a look

@github-actions github-actions bot added the Stale label Apr 11, 2024
@markets
Copy link
Member

markets commented Apr 15, 2024

ℹ️ This issue is stale because it has been open for more than 90 days with no activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants