typelevel/Laika

Feature request for io module: last modified date

i10416 opened this issue · 4 comments

It would be better if we can get last modified date and time of document as Option[DateTime] to improve search result on the web. For example, blog post, rss feed and sitemap usually have last modified datetime field.

e.g. honkit(former gitbook) provide variable mtime to get last modified date and time.
https://honkit.netlify.app/templating/variables.html#file-variables

Sounds like a good idea. Can we flesh this out in a bit more detail?

  1. Where exactly in the API do you want to surface this info?

  2. I assume you'd also want this in the variable substitutions available for templates?

  3. How/where would you use this in the rendered output? Is this something you'd suggest to add to Helium's default templates? One of the goals for 0.19 is that users or integrators like other plugins do not need to provide full copies of the templates, so it's relevant in that context.

1,2. I want Document to expose : lastModifiedAt: Option[DateTime] for low level API and variable substitution as high level API.

3 Main use cases are typical web contents such as blog post, rss feed and sitemap. Thus, It would be nice to specify date time format like @lastMod(RFC822)

Is this something you'd suggest to add to Helium's default templates?

No, for now I just want standard directives contain last modified time substitution, but don't mean to add it to Helium default.

@i10416 - I finally looked into this in detail and it turned out that this ticket is actually 3 feature requests in one. 🙂
For this reason I'm going to close this ticket now in favor of three new ones. Please contine all future discussion in the three tickets linked below (the first two are PRs ready to be merged, the 3rd is a ticket for the future):

  • #277 - (there already was support for dates, but I felt like it could be improved).
  • #276
  • #278 - out of scope for 0.19 as explained in the new issue

@jenshalm Thanks! I take a look at them.