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

Render current page while loading the other pages #2

Open
thangngoc89 opened this issue Jul 9, 2021 · 2 comments
Open

Render current page while loading the other pages #2

thangngoc89 opened this issue Jul 9, 2021 · 2 comments

Comments

@thangngoc89
Copy link
Collaborator

thangngoc89 commented Jul 9, 2021

Since Paradoc loads documents in a waterfall order, it takes around 5 seconds to render locally (using file:// protocol) or 30 seconds remotely.
The project contains 46 pages.

I would suggest displaying the current page first then load the rest of the pages later.

After digging into the codebase, I would suggest a change to page configuration.

  • Root page (usually README.html or index.html) would has a new yaml header called pages that would list all pages in order.
  • Child pages only need to define rootPage.

Benefits of this procedure :

  • This allows easily move files around and re-ordering pages
  • Deterministic sticky page headers order.
  • Load pages in parallel
@thangngoc89 thangngoc89 changed the title Render current page while the rest of the page Render current page while loading the other pages Jul 9, 2021
@jordwalke
Copy link
Owner

One other benefit of this:
There's a workflow where you add a new page entry to the pages: yaml key in the root page. On page reload (or live reload), it detects you've added a new page that doesn't yet exist on disk (the fetch fails). It then has a little notification in the corner saying "You've added a new page. Click to download the new page and save it alongside your existing pages".
When you click it, it downloads the page with a page title, the script header, and the rootPage: already set to the main root page.

I'm not even sure the rootPage is necessary if development mode always loads through the main entrypoint page.

@thangngoc89
Copy link
Collaborator Author

Yeah. Notify about a missing page would be a nice benefit of this.
The rootPage is necessary because it needs to know where to find pages header.

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