Closed white-gecko closed 6 years ago
after a period of longer testing, I determined the problem not to be in jekyll-rdf but in Jekyll itself. For conformation, I wrote a simple plug-in with the following code (corresponds to https://jekyllrb.com/docs/plugins/#generators)
module Jekyll
class CategoryPage < Page
def initialize(site, base, layout, path)
@site = site
@base = base
@name = path
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), layout)
end
end
class CategoryPageGenerator < Generator
safe true
def generate(site)
site.pages << CategoryPage.new(site, site.source, "document.html", "Testfile1.html")
site.pages << CategoryPage.new(site, site.source, "document.html", "Testfile2.html")
site.pages << CategoryPage.new(site, site.source, "document.html", "Testfile3.html")
site.pages << CategoryPage.new(site, site.source, "document.html", "Testfile4.html")
end
end
end
I also simplified our Layouts:
---
---
<!DOCTYPE html>
<html>
<body>
<h1>Default</h1>
{{ content }}
</body>
</html>
---
layout: "default"
---
<ul>
<li>
ListElement
</li>
</ul>
<p>
Content:<br/>
{{ content }}
</p>
For Testfile4.html we still get an output like that
<head></head><body>
<h1>Default</h1>
<ul>
<!-- <li>PageRDF (this URI): </li>
<li>rdfs:label: </li> -->
<li>
ListElement
</li>
</ul>
<p>
Content:<br>
</p><ul>
<!-- <li>PageRDF (this URI): </li>
<li>rdfs:label: </li> -->
<li>
ListElement
</li>
</ul>
<p>
Content:<br>
</p><ul>
<!-- <li>PageRDF (this URI): </li>
<li>rdfs:label: </li> -->
<li>
ListElement
</li>
</ul>
<p>
Content:<br>
</p><ul>
<!-- <li>PageRDF (this URI): </li>
<li>rdfs:label: </li> -->
<li>
ListElement
</li>
</ul>
<p>
Content:<br>
</p><p>This is index in Hallo</p>
<p></p>
<p></p>
<p></p>
<p></p>
</body>
I also tried to reverse the order of site.pages
with .reverse!
which didn't fix the problem. That means, we are not able to fix the problem by resetting a variable between the rendering processes, since the rendering process itself is not pluggable yet(see https://github.com/jekyll/jekyll/issues/5645).
Ok, so maybe we should open an issue an jekyll together with our MWE. Maybe we can also provide a pull request for jekyll?
@Simaris could you please clarify our use case in the MWE?
I've put the MWE in https://github.com/white-gecko/MWE-jekyll-rdf-layouts-content-issue
even simpler: There are two layouts
_layouts/default.html
and_layouts/document.html
default:
document:
a file
hallo/index.md
:a graph:
_config.yml
Depending on the order of the pages in the classmap the pages are replicating the content of the previous page additionally the content of
hallo/index.md
is also rendered to all pages:http://example.org/project/
:Expected is:
and