learnlayout
learnlayout copied to clipboard
Page title is always "about this site"
On learnlayout.com as well as when I clone and build the current repository, every site has the title
<h1 class="content">about this site</h1>
instead of, e.g.
<h1 class="content">the box model</h1>
see https://learnlayout.com/box-model.html.
Unfortunately, I don't know enough about jekyll or if this might be a bug in some tool/library.
Thank you for reporting this! I will take a look as soon as I'm able.
@incompl any update on this issue?
The latest code in the repo seams to compile into a correct version. The problem has obviously been solved. It might just need a re-deploy.
This looks like it's still broken, when I build locally with jekyll 4.
It looks like the localization plugin is receiving a different key than expected. From what I can tell, jekyll is doing one pass of liquid transforms, then caching the results. When it renders the template again, the localization plugin sees a cached copy of page.title
(about.title
) and it looks up about.title
.
I added these debug lines to _plugins/localize.rb
's render method, and saw a lot of spots where the page title did not match what was getting fed into the plugin!
if @key == "about.title"
puts "key is #{@key}, page.title is: #{context.registers[:page]["title"]}"
end
https://github.com/jekyll/jekyll/pull/7967 was the Jekyll bugfix that should have solved this kind of issue, but it looks like it clears template assigns, not template registers, which is the cache that's breaking things here. Lots of potential ways around it - the easiest is probably to just do a hacky fix that checks for .title
literally, which will solve the immediate problem, though is wrong in general. The longer term fix might be upstream in jekyll (clear the cached registers) or to somehow recover the context in the plugin.
I fixed this finally!