hasura / gatsby-gitbook-starter

Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
https://hasura.io/learn/graphql/react/introduction/
MIT License
984 stars 378 forks source link

Sorting as you add new MD file #26

Closed jugraj closed 5 years ago

jugraj commented 5 years ago

When you add a new MD file to content folder it gets appended to the bottom of the the sidebar, however the order of the Back and Next arrows is all messed up.

The Back and Next arrows follow sorting alphabetically whereas the sidebar adds the navigation by order of file added. e.g.; in image below the order of nav is based by the sequence of files added:

image

But here the sequence of Back and Next arrow is not following the sidebar nav: I am in Verification and I have Back Button saying Use SDK in Node.

image

Is there a possibility to sort sidebar nav based by title alphabetically as followed in Next and Back arrows, without the need to update forcedNavOrder?

i001962 commented 5 years ago

Do you get the same results after clearing the cache and rebuilding? I ran into some weirdness with prev/next as well as the leftnav ordering after restructuring content folder but all seems to work as designed after

rm -rf public && rm -rf .cache
jugraj commented 5 years ago

Thanks @i001962 that seem to have fixed the issue! Just wondering if there can be a seamless release to tackle this issue :)

praveenweb commented 5 years ago

@jugraj - This happens due to Gatsby caching the content. If the entire structure is changed, i'm not sure the cache works. The seamless way would be to remove cache during major structure changes. gatsby clean would work for clearing the cache. May be you can package it in your npm script.