avillafiorita/jekyll-datapage_gen

Support setting a prefix for the generated page data

marceloverdijk opened this issue · 0 comments

To avoid name clashes (e.g. a name field) this plugin already does:

  if data.key?('name')
    data['_name'] = data['name']
  end

  self.data.merge!(data)

I'm having an issue that I have other name clashes as well.

This feature request is to be able to prefix the page data. Maybe something:

# - `page_data_prefix` is the prefix used to output the page data.

And then use it like:

page_gen:
  - data: members
    page_data_prefix: member

this would generate:

---
title: alex
member:
  id: 34251
  name: Alex
  age: 34
---

When such a prefix is used the _name workaround should be omitted of course.