website icon indicating copy to clipboard operation
website copied to clipboard

Handle when documents are deleted

Open molant opened this issue 3 years ago • 6 comments

Currently we are not taking into consideration when a document is deleted as it is still part of the sidebars and the build fails.

molant avatar Nov 04 '21 17:11 molant

can i get assigned to this task?

paul-111 avatar Mar 12 '22 14:03 paul-111

Sorry for the delay, yes you can work on this @paul-111 !

molant avatar Mar 22 '22 17:03 molant

Hi. I think we can fix this by making changes in the sidebar.js file. Currently the file is statically taking references for the pages, I think I can write some javascript function that will dynamically generate sidebar items. Am I thinking in the right direction?

DevanceJ avatar Mar 10 '24 14:03 DevanceJ

@DevanceJ the sidebar.js file is created by the create-sidebar.ts file. What needs to change seems to be that function.

but a question to maintainers is, why not generate on each pre-build, and choose instead to refer to the existing sidebars.js file? It technically is only 390 lines so not much time optimisation by writing it this way?

c6z3h avatar Apr 14 '24 13:04 c6z3h

Hey, I'll take a look into this. Thank you

DevanceJ avatar Apr 16 '24 13:04 DevanceJ

@erickzhao could you help advise whether generating sidebar.js from scratch might be good? Building from scratch without an existing sidebar.js returns a very different page menu tree as compared to with existing sidebar.js. Though, the latter is the one consistent with the live electronjs website. Thanks in advance!

c6z3h avatar Apr 17 '24 05:04 c6z3h