avillafiorita/jekyll-datapage_gen

Page name with publish date ?

Closed this issue · 2 comments

Hi,
I'm using jekyll-contentful-data-import and jekyll-datapage_gen to generate post data.

My json:

---
blogpost:
- sys:
    id: 6Ff1pif1ZzOewN0KXUByny
    created_at: !ruby/object:DateTime 2020-01-31 06:39:08.795000000 Z
    updated_at: !ruby/object:DateTime 2020-01-31 08:19:42.720000000 Z
    content_type_id: blogpost
    revision: 3
  title: Blog post
  subtitle: Lorem ipsum dolor commet
  article: __Lorem Ipsum__ is simply dummy text of the printing and typesetting industry.
    Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
    when an unknown printer took a galley of type and scrambled it to make a type
    specimen book. It has survived not only five centuries, but also the leap into
    electronic typesetting, remaining essentially unchanged. It was popularised in
    the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
    and more recently with desktop publishing software like Aldus PageMaker including
    versions of Lorem Ipsum.

My _config.yaml

page_gen:
  - data: contentful.spaces.blog.blogpost
    template: blog
    name: title
    dir: blog
    extension: html

and i get this structure:

blog
    blog-post.html
    drugi-post.html

Its possibility to have something like this ?

blog
    2020-01-31-blog-post.html
    2020-01-30-drugi-post.html

When im trying change name or name_expr attribute to to get created_at i have error
undefined method `tr' for 2020-01-30 00:00:00 +0100:Time

Can you help me or at least indicate the direction where to look for a solution?

Hi,
[sorry I took ages to get back to you]
It seems to be an issue with the data type: did you try to put a to_s before the call to tr?

Replacing the string helped :) thank you