avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
369 stars 80 forks source link

Data member 'name' clash #46

Closed jayvdb closed 4 years ago

jayvdb commented 6 years ago

If the data entries have a member 'name', it will be inaccessible because page.name will refer to the Jekyll page objects name. Likewise title, etc

avillafiorita commented 6 years ago

thanks for the report.

The issue is due to the way in which the plugin merges the hash read from the data files into the page variables.

Related to #17.

I will look into it when I have some time: it the meantime, any suggestion or fix is very welcome!

jayvdb commented 6 years ago

For my case, the workaround is rather easy.

I can use name: name in _config.yml, and then refer to it using page.title.

A more versatile approach would be to replace name: with a mapping of data field names to desired frontmatter fields. Then the user can always map conflicts to a new field name of their choice.

avillafiorita commented 4 years ago

should now be fixed thanks to the recent pull request #75 by @marceloverdijk