nuxt-themes / docus

Write beautiful documentations with Nuxt and Markdown.
https://docus.dev
MIT License
1.59k stars 156 forks source link

GitHub pages improvements #599

Closed Tahul closed 1 year ago

Tahul commented 2 years ago

I think Docus could benefit having a page using components from nuxtlabs/github-module, such as <GithubRepository /> and <GithubReadme />

Also, I would love this issue to be an opportunity to fix the flashes on client-side navigation with this components (can be seen on release page from client-side nav)

smarroufin commented 2 years ago

I don't understand what's happening :grimacing:

First I inspected the GithubReleases component from @nuxtlabs/github-module. This component does a useAsyncData, intended to block the whole page.

I went with the theory it was a Nuxt issue, I discussed it with @Atinux quickly. I made a stackblitz to make sure it was a Nuxt issue around suspens as Atinux suggested. https://stackblitz.com/edit/nuxt-starter-fytar6

It turns out in my reproduction using useAsyncData works well in a component, blocking the whole page on client side while resolving the async execution. So no issue from Nuxt, at least in a Nuxt pure context.

My second thought would be that it only happens in a Content context, with Content loading pages in a specific way. But it's outside of my area of expertise. Leaving it to you @Tahul

smarroufin commented 2 years ago

Doesn't occur on a Content stack, I'm lost https://stackblitz.com/edit/github-j1oep1

atinux commented 2 years ago

Can you try with the documentDriven mode @smarroufin ?

https://content.nuxtjs.org/guide/writing/document-driven

atinux commented 2 years ago

I see, the issue comes from the Document Driven mode @Tahul @smarroufin

https://stackblitz.com/edit/github-j1oep1-bjog63?file=nuxt.config.ts,content%2F2.about.md

atinux commented 2 years ago

Can you look at this @farnabaz ?

Tahul commented 1 year ago

I think this is resolved now as most Docus sites uses GitHub pages properly.

GitHub components will be tracked there now: https://github.com/nuxt-themes/elements/issues/160