python-discord / site

pythondiscord.com - A Django and Bulma web application.
https://pythondiscord.com
MIT License
639 stars 127 forks source link

Improve the navigation experience for content pages #1233

Open hedyhli opened 6 months ago

hedyhli commented 6 months ago

We have some high-quality articles over at /pages/ and I look forward to seeing more. However, as someone who has a fairly sound grasp of the organization and structure of the content as compared to a new user, I still struggle to navigate and discover more pages with ease. I often find myself stumbling upon pages I have not seen years before (despite themselves being present) as well as having troubles recalling the hierarchies of the content when needing to link a page to someone on the server.

I believe it's possible to improve the situation by adding a left column that displays the tree of links representing the hierarchy of content pages - siblings, parents, children (not the headings of the page).

Mock implementation image

What we have currently

The breadcrumb at the top of each page lets you jump to one of the parent pages. It's great to know where you are and what else is there higher up the hierarchy, however it doesn't make it easy to directly browse exactly what else is there and visit those pages.

The sub-articles dropdown lets you see the pages under the current page and jump to one of them, but it feels clunky to use and is not very discoverable. Compare this to something like readthedocs themes, Mkdocs themes, the left column is almost impossible to miss, and it easily becomes your main source of discovery for new pages of interest.

Our contributing pages have a lot of sub-pages with valuable information that is very easy to be missed. Some of the sub-pages even have sub-pages of their own. For someone trying to find their way around making contributions to our repositories, it could be daunting to look at the dropdown and not know which page they might need. Each time they finish reading a sub-article they would have to go back to the preview page before attempting to find the right position of the previously visited sub-article, and finally click on the next link. I have experienced this inconvenience personally and I'm sure many new users would go through a similar process.

All this can be improved significantly with the introduction of better navigation component commonly found in documentation websites.

Co-existing with the ToC column

The column for table of contents on the right is great, it's optionally enabled based on the article metadata. Introducing another column on the left of the content alongside the table of contents is still possible.

Modal sidebar example [πŸ”—](https://goreleaser.com/customization/env/) image

https://github.com/python-discord/site/assets/50042066/6fe9ecb9-b1f0-492a-a66e-714d9e01daac

The screencast above illustrates the distinction between toggle of visibility that squishes main content verses one that covers the main content.

And what about category pages?

While the box shadows and title icons for the category listings makes the category pages clear and appealing, it can also benefit from a makeover that makes use of tree-like navigation. Unlike GitHub, we don't have a lot of tabular information like last commit dates to show.

An example of this in action image

The categories can be toggled to collapse pages under it, with each category page showing the direct children by default, all other pages are hidden until toggled.

We could also just show the same sidebar as those on normal pages, just like GitHub does for directories.

This can make use of a reusable component defined for the sidebar used on content pages.

One might argue it's out of scope for this issue, so I'll leave this up to discussion and for the one who implements this feature.

The specifics

An ideal implementation might look something like the following (note that these are only ideas and is still up to discussion).

More examples

Consider these only for inspiration:

Appendix

These are only for reference to gauge the approximate length and maximum indent level for a tree.

A fully expanded tree for all content pages ``` . β”œβ”€β”€ _info.yml β”œβ”€β”€ code-of-conduct.md β”œβ”€β”€ frequently-asked-questions.md β”œβ”€β”€ guides β”‚ β”œβ”€β”€ _info.yml β”‚ β”œβ”€β”€ pydis-guides β”‚ β”‚ β”œβ”€β”€ _info.yml β”‚ β”‚ β”œβ”€β”€ asking-good-questions.md β”‚ β”‚ β”œβ”€β”€ code-reviews-primer.md β”‚ β”‚ β”œβ”€β”€ contributing β”‚ β”‚ β”‚ β”œβ”€β”€ _info.yml β”‚ β”‚ β”‚ β”œβ”€β”€ bot-extended-configuration-options.md β”‚ β”‚ β”‚ β”œβ”€β”€ bot.md β”‚ β”‚ β”‚ β”œβ”€β”€ cloning-repository.md β”‚ β”‚ β”‚ β”œβ”€β”€ commit-messages.md β”‚ β”‚ β”‚ β”œβ”€β”€ configure-environment-variables.md β”‚ β”‚ β”‚ β”œβ”€β”€ contributing-guidelines.md β”‚ β”‚ β”‚ β”œβ”€β”€ creating-bot-account.md β”‚ β”‚ β”‚ β”œβ”€β”€ docker.md β”‚ β”‚ β”‚ β”œβ”€β”€ forking-repository.md β”‚ β”‚ β”‚ β”œβ”€β”€ hosts-file.md β”‚ β”‚ β”‚ β”œβ”€β”€ installing-project-dependencies.md β”‚ β”‚ β”‚ β”œβ”€β”€ issues.md β”‚ β”‚ β”‚ β”œβ”€β”€ linting.md β”‚ β”‚ β”‚ β”œβ”€β”€ logging.md β”‚ β”‚ β”‚ β”œβ”€β”€ obtaining-discord-ids.md β”‚ β”‚ β”‚ β”œβ”€β”€ pull-requests.md β”‚ β”‚ β”‚ β”œβ”€β”€ setting-test-server-and-bot-account.md β”‚ β”‚ β”‚ β”œβ”€β”€ sir-lancebot β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ _info.yml β”‚ β”‚ β”‚ β”‚ └── env-var-reference.md β”‚ β”‚ β”‚ β”œβ”€β”€ sir-lancebot.md β”‚ β”‚ β”‚ β”œβ”€β”€ site.md β”‚ β”‚ β”‚ β”œβ”€β”€ style-guide.md β”‚ β”‚ β”‚ β”œβ”€β”€ working-with-git β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ _info.yml β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ cli.md β”‚ β”‚ β”‚ β”‚ └── pycharm.md β”‚ β”‚ β”‚ └── working-with-git.md β”‚ β”‚ β”œβ”€β”€ contributing.md β”‚ β”‚ β”œβ”€β”€ help-channel-guide.md β”‚ β”‚ β”œβ”€β”€ helping-others.md β”‚ β”‚ β”œβ”€β”€ how-to-contribute-a-page.md β”‚ β”‚ └── off-topic-etiquette.md β”‚ └── python-guides β”‚ β”œβ”€β”€ _info.yml β”‚ β”œβ”€β”€ app-commands.md β”‚ β”œβ”€β”€ creating-python-environment-windows.md β”‚ β”œβ”€β”€ discord-embed-limits.md β”‚ β”œβ”€β”€ discord-messages-with-colors.md β”‚ β”œβ”€β”€ discordpy-subclassing-context.md β”‚ β”œβ”€β”€ discordpy.md β”‚ β”œβ”€β”€ discordpy_help_command.md β”‚ β”œβ”€β”€ docker-hosting-guide.md β”‚ β”œβ”€β”€ fix-ssl-certificate.md β”‚ β”œβ”€β”€ keeping-tokens-safe.md β”‚ β”œβ”€β”€ mutability.md β”‚ β”œβ”€β”€ parameters-and-arguments.md β”‚ β”œβ”€β”€ proper-error-handling.md β”‚ β”œβ”€β”€ setting-different-statuses-on-your-bot.md β”‚ β”œβ”€β”€ subclassing_bot.md β”‚ β”œβ”€β”€ vps-services.md β”‚ └── why-not-json-as-database.md β”œβ”€β”€ privacy.md β”œβ”€β”€ rules.md β”œβ”€β”€ security-notice.md β”œβ”€β”€ server-info β”‚ β”œβ”€β”€ _info.yml β”‚ β”œβ”€β”€ roles.md β”‚ └── staff-role-expectations.md └── tags └── _info.yml ```
A fully expanded tree for all contributing pages ``` . β”œβ”€β”€ _info.yml β”œβ”€β”€ bot-extended-configuration-options.md β”œβ”€β”€ bot.md β”œβ”€β”€ cloning-repository.md β”œβ”€β”€ commit-messages.md β”œβ”€β”€ configure-environment-variables.md β”œβ”€β”€ contributing-guidelines.md β”œβ”€β”€ creating-bot-account.md β”œβ”€β”€ docker.md β”œβ”€β”€ forking-repository.md β”œβ”€β”€ hosts-file.md β”œβ”€β”€ installing-project-dependencies.md β”œβ”€β”€ issues.md β”œβ”€β”€ linting.md β”œβ”€β”€ logging.md β”œβ”€β”€ obtaining-discord-ids.md β”œβ”€β”€ pull-requests.md β”œβ”€β”€ setting-test-server-and-bot-account.md β”œβ”€β”€ sir-lancebot β”‚ β”œβ”€β”€ _info.yml β”‚ └── env-var-reference.md β”œβ”€β”€ sir-lancebot.md β”œβ”€β”€ site.md β”œβ”€β”€ style-guide.md β”œβ”€β”€ working-with-git β”‚ β”œβ”€β”€ _info.yml β”‚ β”œβ”€β”€ cli.md β”‚ └── pycharm.md └── working-with-git.md ```
wookie184 commented 5 months ago

This is a great idea, and would be really useful for things like the contributing section as you mention.

I do think that the category pages changes would be out of scope for this. It's already a pretty big task, and there are potentially also other things to consider w.r.t category pages, since I think going More->content from the main page to get a jumbled list of things is another issue and could potentially do with a bigger rethink in how individual sub-sections are accessed.

hedyhli commented 5 months ago

Yes, I think I'll agree that applying this hierarchical layout for category pages will be out of scope for this issue for now. Although it would be great to see at a glance just what pages/guides we have when clicking on the "Content" navbar item, it can be pretty overwhelming and we could just have this issue apply to particular content pages that might benefit from this (or all pages?) such as the contributing guides.