Giter Site home page Giter Site logo

Comments (6)

ilg-ul avatar ilg-ul commented on April 28, 2024 1

Let me know if there are features you want to work on in priority. I'd like to give some of them to my intern.

I'm in no hurry, you can give all of them to your intern, just add me to the discussion to keep track of the progress.

Probably the Authors feature should require some extra attention.

from docusaurus.

slorber avatar slorber commented on April 28, 2024

I'd prefer to not implement the concept of "event" in the blog plugin: this is proprietary logic of your site.

However, we could provide you primitives and hooks to sort and re-order the blog posts for all views (pagination, archive, sidebar...) according to your custom front matter. This is more flexible and unlocks other fancy use cases as well.

Also suggested in #9827

If you only want to re-order the content of the archive page (and not other views), I'd suggest to swizzle and sort directly inside the appropriate React component, using your custom metadata at post.metadata.frontMatter.event_date

from docusaurus.

ilg-ul avatar ilg-ul commented on April 28, 2024

However, we could provide you primitives and hooks to sort and re-order the blog posts for all views

If such a solution will be implemented, I'll reevaluate.

I tried swizzling and ordering inside components, but faced difficulties, for example I thought that the next/previous links in each posts should link to articles ordered by in the event date, not the post creation or even post last update, while the posts in the feeds need to use the last update time.

The second attempt was to write a separate plugin, but the solution got too complex due to dependencies with other plug-ins.

Thus in the end I forked and experimented with all these changes.

If you think a similar functionality can be obtained with hooks, sure, but there will probably be more, for example the formatted date in the Archive page also needs to use the event_date/event_end_date, when available.

from docusaurus.

slorber avatar slorber commented on April 28, 2024

I tried swizzling and ordering inside components, but faced difficulties

Swizzling to re-order items will only work for non-paginated lists, such as the archive page and the sidebar list.

I thought that the next/previous links in each posts should link to articles ordered by in the event date, not the post creation

Next/previous linking is done based on the order of the posts, so if we let you sort them before doing this navigation linking based on your custom attributes, the linking will be consistent with the display order of the paginated lists

the posts in the feeds need to use the last update time.

You can define a custom order for the RSS feed thanks to createFeedItem()


If you created me a runnable minimal docusaurus.new repro using only a few blog posts and a clear specification for what each screen/component/feed should render, I would be able to show you a solution, or at least understand better the missing primitives to implement.

from docusaurus.

ilg-ul avatar ilg-ul commented on April 28, 2024

Since you do not plan to include this functionality as-is, I suggest to leave this proposal at the end, and focus on features you already agreed to include.

However, when adjusting the design for the other features, we should keep in mind that there might be use cases when custom front matter properties will be used, which will affect the order of the posts and the logic to format dates in some components (like the Archive page).

from docusaurus.

slorber avatar slorber commented on April 28, 2024

Since you do not plan to include this functionality as-is, I suggest to leave this proposal at the end, and focus on features you already agreed to include.

Agree 👍

However, when adjusting the design for the other features, we should keep in mind that there might be use cases when custom front matter properties will be used, which will affect the order of the posts

I'm pretty sure once we extend sortPosts to allow functions you'd be able to achieve your needs, but for that, we'll have to iterate on a https://docusaurus.new repro to be sure.

and the logic to format dates in some components (like the Archive page).

the logic to format dates should be overriden with swizzle


Let me know if there are features you want to work on in priority. I'd like to give some of them to my intern.

from docusaurus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.