Replies: 3 comments 5 replies
-
|
Show me a runnable example of your attempt. A wall of text is not super helpful and I might not interpret it well. Links you might be interested in: |
Beta Was this translation helpful? Give feedback.
-
You can swizzle that component and render another front matter date (or plain string) if you want to.
The date is what drives the blog post pagination ordering and the initial feed order (that you can alter with It doesn't mean that technically you have to display that date. You can swizzle all components and display another custom front matter field if you want.
We don't provide this ATM. What is the problem with ordering by date considering you don't have to display that date? Even if you have events like "April 1969" or "1969 year", at some point you have to be explicit and tell Docusaurus which one should appear first in the list, so giving us an explicit instant in time permits to create a predictible order.
We already implement a plugin system, and you can copy/paste our blog plugin and adapt it to your needs if needed. Note that the blog plugin is not a chronology plugin. I'm ok to consider extension points but I'm not convinced what you want is needed for regular users that want to implement a blog, unless you prove otherwise. To proceed further, I'd kindly ask you to put your time in to create a minimal repro and mockups of your desired outcome, otherwise we are losing time with walls of texts and no concrete solution. A link to your prod site is convenient for you, but not for me. Please:
Only then I'll be able to tweak your runnable sandbox and adapt it to fit your need, by giving you actual code instead of writing words. |
Beta Was this translation helpful? Give feedback.
-
|
As requested, I created: There is no need for mockup pages, the existing ones look fine. The question is how to customise the blog plugin to sort the posts in the Archive page and the posts below specific Tags, to use the The content of
The logic to process the custom frontmatter properties probably can be accommodated by the |
Beta Was this translation helpful? Give feedback.





Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to customise
docusaurus-plugin-content-blog, to accommodate a chronology, where posts, in addition to the creation date, also have a separate event date.Since docusaurus currently processes only a single date, I stored the event date in
frontmatter.date, and the creation date asfrontmatter.creationDate. This is generally fine, I see the events grouped by actual dates in the archive pages, but it has some disadvantages, like not knowing when the posts were created and the rss.xml not listing the most recent posts.One possible fix would be to customise the feed generation (which does not seem trivial, at least I could not find a way to swizzle it).
Another fix would be to revert to using
frontmatter.datefor the creation date, and a separatefrontmatter.eventDate.However this requires some customisations in
blogUtils.ts, where I have to also create lists of posts sorted by event date.I managed to swizzle some components, but I could not find a convenient way to customise
blogUtils.ts, and forking the entire plug-in is not very attractive since it adds a significant maintenance cost.My application may not be very common, but raises an issue which might be helpful for others, which is a generic mechanism to customise code outside the components listed by swizzle.
Is there such a mechanism? If not, would it be worth designing one?
Beta Was this translation helpful? Give feedback.
All reactions