nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Rename configurations

Open shuding opened this issue 1 year ago • 20 comments

I'm working on the docs and noticed some option names that can be improved for better consistency and accuracy. This will be another breaking change for v2, hopefully the last one.

  • [ ] banner.textbanner.content
  • [ ] footer.textfooter.content
  • [ ] editLink.texteditLink.content
  • [x] feedback.linkfeedback.content
  • [x] bodyExtraContentmain.extraContent (in the future we can configure the main content area here)
  • [ ] i18n.texti18n.name
  • [x] projectChatchat
  • [x] github → removed, use project.link

shuding avatar Sep 10 '22 10:09 shuding

unstable_faviconGlyph Should be renamed too

dimaMachina avatar Sep 10 '22 14:09 dimaMachina

I think all the unstable_ can be removed since we've tested them for so long.

shuding avatar Sep 10 '22 14:09 shuding

Is there a way to completely disable editLink?

If I remove the param, the link still shows as "Edit this page" and leads to the Nextra repo (apparently, it's the default value)

raproid avatar Sep 26 '22 17:09 raproid

editLink: { component: null }

dimaMachina avatar Sep 26 '22 17:09 dimaMachina

Thanks you very much!

raproid avatar Sep 26 '22 18:09 raproid

Btw, you may consider shrinking space for lists.

If, say,

  1. I start
  2. with a numbered list 2.1 and then want to include a sublist 2.2 the sublist is separated by a huge line that is higher than a normal one

Same for an introductory sentence and a list following it.

Same for separating lines in callouts in general.

See the screenshots: Screen Shot 2022-09-26 at 10 36 06 PM Screen Shot 2022-09-26 at 10 36 19 PM Screen Shot 2022-09-26 at 10 42 14 PM

raproid avatar Sep 26 '22 19:09 raproid

You may also want to introduce routing to the 404 page.

For example, adding a link "Go to the main page"/"Return to the main page" below the 404 message. That would improve user experience by tonnes, since otherwise the user doesn't have any means of navigating from the 404 page within the web app, but only through the address bar and the browser arrows.

image

raproid avatar Sep 26 '22 19:09 raproid

You may also want to introduce routing to the 404 page.

For example, adding a link "Go to the main page"/"Return to the main page" below the 404 message. That would improve user experience by tonnes, since otherwise the user doesn't have any means of navigating from the 404 page within the web app, but only through the address bar and the browser arrows.

image

It’s already introduced but not documented yet :), thanks for the catch!

dimaMachina avatar Sep 26 '22 20:09 dimaMachina

@raproid

Btw, you may consider shrinking space for lists.

Yeah would love to fix that, could you open a new issue for that? Unrelated to this one.

shuding avatar Sep 26 '22 23:09 shuding

@B2o5T can I have the param names and values for my own use?

@shuding here you go

raproid avatar Sep 27 '22 00:09 raproid

https://github.com/shuding/nextra/blob/core/examples/swr-site/pages/404.mdx https://github.com/shuding/nextra/blob/core/examples/swr-site/pages/_meta.en-US.json

dimaMachina avatar Sep 27 '22 01:09 dimaMachina

@B2o5T Thank you!

raproid avatar Sep 27 '22 08:09 raproid

@shuding @B2o5T is there a way to make a page available directly by the URL but not list it in the sidebar menu?

raproid avatar Sep 27 '22 09:09 raproid

@shuding @B2o5T sorry to be a bother, but is there a way to make a page available directly by the URL but not list it in the sidebar menu? I'm really interested in this feature.

raproid avatar Sep 28 '22 14:09 raproid

@raproid could you describe more? Don't understand your question

dimaMachina avatar Sep 30 '22 14:09 dimaMachina

@B2o5T I’m speaking about hiding a page from the sidebar menu. Eg, Docusaurus, which I used before, would generate pages from every .md file in the source folder “docs” but I’d have to include them into the sidebar.js by hand for them to appear in the left sidebar navigation menu. If I didn’t, I’d be able to access the page directly by the URL, but it would be invisible for anybody who uses the left sidebar menu for navigation.

It is nice for some content you want to expose only by the link to a specific audience.

raproid avatar Sep 30 '22 14:09 raproid

@B2o5T makes sense?

raproid avatar Sep 30 '22 15:09 raproid

@raproid try this https://github.com/shuding/nextra/blob/a04c128c240fdc1fd43f8f1bb6961a0eb99872eb/examples/swr-site/pages/_meta.en-US.json#L5

dimaMachina avatar Oct 04 '22 10:10 dimaMachina

@B2o5T it is working!!! Thank you very much!

raproid avatar Oct 04 '22 11:10 raproid

For those who are new like me, you need to change the following in the theme.config.js file

{
bodyExtraContent: ''
}

to

{
  main: {
   extraContent: '',
   }
}

champsupertramp avatar Oct 14 '22 05:10 champsupertramp