Comments (6)
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.
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.
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.
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.
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.
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)
- Hide redundant year in dates shown in the Archive page HOT 9
- Error when importing Docusaurus Swizzle component into Netlify CMS HOT 1
- Change code highlight module to Shiki HOT 1
- MDX fails building website when using a <code> inside of a <TabItem> element HOT 3
- 'baseUrl' is ignored in Production routing HOT 5
- Error when importing Docusaurus Swizzle component into Netlify CMS HOT 1
- Allow `tags` in `generated-index` sidebar item HOT 4
- MDX v3.0.1 fails to import <details> HOT 7
- Tabs not working on Docusaurus Static build HOT 5
- Doesn't support protocol-relative URL's HOT 1
- Layout moves around when switching tabs (scroll position issue) HOT 2
- Scripts in head don't load from component on production HOT 2
- The htmlLang setting in the localeConfigs of i18n is invalid, and the source code remains as en HOT 5
- Pages do not support Markdown "file path" links HOT 6
- navigation to '/index.html' with a static web server duplicates the page's content. HOT 2
- Broken link found where it should not on relative (same folder) link HOT 5
- LastUpdateTime and LastUpdateAuthor are not displayed in some documents HOT 2
- onBrokenAnchors reports spurious broken anchors for every page HOT 3
- [Bug]: `Invalid name=docusaurus-plugin-vercel-analytics version number=0.0.0-5831.` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docusaurus.