avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
367 stars 79 forks source link

Opinion: Layouts used Exclusively for Page Generation Should Be in _templates with Fresh Scope #106

Open desirtech opened 3 years ago

desirtech commented 3 years ago
  1. Thanks @avillafiorita for finishing up this gem into ruby gems! I wish I could hand solutions before presenting new problems but all in good time.
  2. Surprisingly, liquid can be used in template front matter to set with datafile. ex.
    - id: home # [note]: title & content keys overlap with Layout variables. 
    data: >- my lovely content. 
    layout: basic
    perma: /:id/
    prop: value
---
layout: {{ page.layout }} 
prop: {{ page.prop }}
permalink: {{ page.perma }}
---

# {{ page.id }}
### {{ page.data }} 
  1. However, I feel this means templates used for DataGen are fundamentally different than regular layouts, so why not have their own directories? This would allow for better variable scoping too because currently, page.[key], overlaps with regular Layout object (I use 'data' instead of content due to clash).

_templates would be great! Let's all work to makes this the most feature rich gem ever! The ability to author content and configs all from YAML isn't to be taken lightly.

avillafiorita commented 2 years ago

... so sorry for taking so long to start looking at your issue... been extremely busy with a new job.

Interesting idea. I'll look into the matter!

Thanks for the report and sorry again for the time it took me to acknowledge the bug.