ekoeryanto / vuepress-plugin-sitemap

Sitemap generator plugin for vuepress.
MIT License
93 stars 19 forks source link

Enhance in dateFormatter #33

Closed Mister-Hope closed 4 years ago

Mister-Hope commented 4 years ago

@vuepress/plugin-last-updated allow us to edit the text generated to the lastUpdate key on page, for me I am using:

    [
      '@vuepress/last-updated',
      {
        transformer: (timestamp: number, lang: string): string => {
          moment.locale(lang);

          return `${moment(timestamp).format('LL')} ${moment(timestamp).format(
            'HH:mm'
          )}`;
        }
      }
    ],

And my lastUpdated are 2020年4月30日 12:46 April 30, 2020 12:46

Currently, there is NO WAY I can get the timeStamp back throught these string, so can we add a option which allow us to read from git directly?

Mister-Hope commented 4 years ago

@ekoeryanto Are you still maintaining it?

b0g3r commented 4 years ago

I think it's a good idea to replace dateFormatter to a (page) => {...} func, so anyone has full control of data when transforms date

Mister-Hope commented 4 years ago

yes, I agree with that, meanwhile I am developing a sitemap plugin for my own.

ekoeryanto commented 4 years ago

Hello @Mister-Hope PR would be great.

Mister-Hope commented 4 years ago

I write a plugin based on sitemapV6 with Stream. It's called @mr-hope/vuepress-plugin-sitemap. And I am busy these days, so I guess I won't open a PR.