Guts/mkdocs-rss-plugin

created date and updated date in metadata

copdips opened this issue · 6 comments

Hello,

I have both dates under the date key in the yaml metadata, could you please provide the syntax to show the created date ?

becase with current syntax:

date_from_meta:
    as_creation: date

I got error:
[rss-plugin] Creation date of xxx.md has not been recognized.

https://squidfunk.github.io/mkdocs-material/plugins/blog/?h=created#meta.date

image

okey, I found it, it should be :

      date_from_meta:
        as_creation: date.created

Hello,

I reopened this issue, as some of my posts use:

date:
   created:  2023-01-31
   updated: 2023-02-21

and some others use:

date: 2023-01-31

is there anyway to handle both of it ?

Guts commented

Hello,

Thanks for your interest and taking time to ask here.

It's not possible to use both for now and dealing with heterogenous date/time formats is quite tricky and really hard to maintain.

In one of my project, I'm using a Mkdocs hook to check date format to warn the author or autofix it if possible.

thx, I will fix that to have one standard everywhere

Hello @Guts

I reopen this issue, as the file git log date is always used by pubData even date_from_meta is specified.

In my mkdocs.yml, I have:

      date_from_meta:
        as_creation: date.created

But when I checked /feed_rss_created.xml, it always uses file git log date instead of date.created in the file front matter.

It seems that the issue from this line: https://github.com/Guts/mkdocs-rss-plugin/blob/b9e340fa799e050b48b0e4be18bb78ee21e17211/mkdocs_rss_plugin/util.py#L180C39-L180C39

It tries to use in_page.meta.get("date.created"), where it should be in_page.meta["date"]["created"]

Guts commented

Released as part of 1.11.1: #238