Improvement of resolvePageDate
#46
Mister-Hope
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
That looks so weird. And will complicate the logic |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, resolvePageDate is returning
1970-01-01
when the Date is empty or invaid. And the date is use to built permalinks.https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/core/__tests__/page/resolvePageDate.spec.ts#L27-L66
And in that case, if set premalink with date globally, we will get links like below with
/1970/01/01/foo-bar/frontmatter
.https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/core/__tests__/page/resolvePagePermalink.spec.ts#L48-L61
I think that's not good enough, visitors would be confused if they are not familiar with coding.
My ideas is to let them fill with
__
(orx
-
_
or something else). so that if global permalinks with date are set, those without valid date would be set as/__/__/__/foo-bar/
. I think this can be much more clear to site owners or visitors to release that it's not having date. 😀Also I would suggest date without day like below return with
2020-10-__
https://github.com/vuepress/vuepress-next/blob/55f780c4a516b2c0119328874906647af80ac73b/packages/%40vuepress/core/__tests__/page/resolvePageDate.spec.ts#L77-L86
So that we can built permalinks like
/2020/10/__/foo-bar/
, looking forward to your opinion.Beta Was this translation helpful? Give feedback.
All reactions