playfulprogramming icon indicating copy to clipboard operation
playfulprogramming copied to clipboard

[Feature]: Upgrade & fix the chapterList feature

Open edpratti opened this issue 1 year ago • 2 comments

Description

The current chapterList feature accepts the following props:

chapterList: [
  {
    order: '',
    title: "",
    description: "",
  },
]

However, when trying to use this for a real-world scenario - embedding content from the website, outside of a collection, into a collection - the feature did not help me, and in fact, didn't work as expected.

Main issues

  • The order prop is meaningless. It is not taken into account when ordering content and instead, all posts added with chapterList are appended at the bottom, making the feature essentially useless for anything other than the only current usecase: A coming soon ? as the value.
  • No url prop. Essentially, every entry is just a string that does not point to anything, and the lack of a url prop makes it impossible to turn it into a link either.

Feature requests

  • Allow the use of a single url prop to link to articles outside of collections.

The syntax for this would look as such:

chapterList: [
  {
    url: '/posts/understanding-the-dom'
    // Extracts the title and snippet automatically
  },
]
  • When given a url, all other props act as overrides.

This is a real need I ran into when attempting to link an article from outside a collection - something I think should be a native feature, as collections should, conceptually, be a global grouping feature as opposed to the author > collection hierarchy we currently have.

The idea is that, when writing an article, you may want to focus on SEO, and that drives the way you title and the descriptions you write in order to maximize that. But when attaching an article to a collection, the idea is to guide the reader, and provide context within the collection for the next chapter.

With this in mind, it would be useful if the title and description acted as overrides when a url is given. This would allow for contextual guidance / consistency with other chapters while maintaining the existing SEO.

edpratti avatar Oct 16 '24 19:10 edpratti

Assigning this ticket to @Aaday321 per convo on our Discord

crutchcorn avatar Jan 28 '25 02:01 crutchcorn

I can also work on this.

BamaCharanChhandogi avatar Jan 28 '25 06:01 BamaCharanChhandogi