Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement request: Generate _category_.json/yml files for names of sidebar dropdown items #17

Closed
JenniBeadle opened this issue Oct 20, 2022 · 5 comments

Comments

@JenniBeadle
Copy link

JenniBeadle commented Oct 20, 2022

Describe the issue
Docusaurus uses the folder names (short with hyphens) for the sidebar dropdowns unless you add category.yml files to each folder to specify the name of the folder. These are also used to translate the folder names.

See discussion on Category item metadata in https://docusaurus.io/docs/sidebar/autogenerated#category-item-metadata

@hatton
Copy link
Member

hatton commented Oct 21, 2022

@JenniBeadle can you say how this will improve things for you?

(Especially if you're making an feature request, you'll want to remove boilerplate text like

Describe the bug
A clear and concise description of what the bug is.

@JenniBeadle
Copy link
Author

I guess you don't have folders in Notion so no wonder you didn't understood. I am trying to improve the folder names in the sidebar.

A picture paints a thousands words. So let me show you what I want to reproduce as I
have on my other sites.

Here is what the sidebar looks like from Notion based Paratext-manual site:
22 01_56_06
The text for the dropdowns is the folder name (complete with hyphens)

Here is what the sidebar looks on my manual.paratext.org site when using edited _ category _.json files
image
The sidebar has clearer names (as supplied by the category files in each folder).

Also when I run the translate command, Docusaurus collects the folder names into a file (current.json) to translate. I haven't worked with Crowd-In so I don't know how they do it. But here is what I got on the French locale of my other site:
image

When I had a repository on my computer I could just add the category files (even to the exported Notion). But with Release actions and no visible files, I can't to it. So I need another way. Just changing the page in Notion doesn't work.

On reflection I wonder if you can really export .json files from Notion. But there must be a way of achieving the end result.

@hatton
Copy link
Member

hatton commented Oct 21, 2022

The side bar items are named after the Outline pages. So instead of having your Notion Outline pages named in these shorthand ways like you are, they should be, based on your screenshots above:

instead of name it
Training Manual Paratext Training Manual
Video Summaries Paratext Video Summaries
Stage-1 Stage 1 Drafting

Etc.

@JenniBeadle
Copy link
Author

JenniBeadle commented Oct 22, 2022

I had tried that before I submitted the enhancement request but it didn't work for me. So what am I doing wrong?

It definitely doesn't work from the cloned repository in localhost because on my computer, it is back in folders.
So I tried the GitHub Release action and as you can see below, it changes spaces to "-" for categories. The file names are OK as it comes from the title.

Here is what I get

image

The ordering is out because I started to delete the initial numbering which normally controls the sort order. I thought it was supposed to be in same order as Notion. But maybe that was still an enhancement request.

@hatton
Copy link
Member

hatton commented Oct 22, 2022

Yeah those dashes are a bug. I'll close this and report that.

@hatton hatton closed this as completed Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants