facebook / facebook/docusaurus

Blog: add more useful content to the sidebar (tags, authors, feeds, links...)

Ouverte
#5,461 10 commentaires 5 réactions 0 personnes assignées Voir sur GitHub
difficulty: intermediate feature
Langage dominant
TypeScript
Étoiles
66.2k
Forks
10k
Merge moyen
1 j 3 h
PR mergées (30 j)
52

Description

## 🚀 Feature

Make the feeds, tags page, archive page, authors page (if the last ever gets implemented) directly visitable from the index page.

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?

Yes

### Has this been requested on [Canny](https://docusaurus.io/feature-requests)?

No

## Motivation

- Currently, to visit the tags page, the user has to click on a tag, then click "view all tags"—that's two layers of Indirection.
- For the feeds, afaik there's currently no way to access them (besides typing in the URL, of course, given that you know where the file lives), or any indication that they even exist.
- From the current status of #5428 (I understand it's still underdeveloped), it's unlikely that a link will be provided on the index page.

I propose we have a "links group" on the blog index page providing access to all these pages.

## API Design

The only place where these links can be tucked in is probably the blog sidebar. The links group can be added below the sidebar title or below the list of post titles. We can even add little icons like "feeds" and "tag" :)

Not sure if it's worth providing options to toggle these links on or off; I guess keeping them won't distort the appearance of the page much anyways

## Have you tried building it?

Because I have a swizzled blog page, I directly added the links group below the blog title: https://joshcena.com/blog/

This is actually pretty easy to achieve in the userland (just wrap the existing BlogSidebar, doesn't even require swizzling), but from a design perspective I find it inadequate for this to be missing from the theme itself.

Edit. I was a bit naïve when I believed we could wrap the sidebar. Turns out that the sidebar has fixed position, but the wrapped one doesn't, so for this code:

```js
export default function BlogSidebar(props) {
return (
<>

Links


);
}
```

The "Links" text just scrolls up when the page is scrolled while the sidebar is fixed. Therefore the user still has to swizzle the Sidebar component, which is undesirable.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.