docz icon indicating copy to clipboard operation
docz copied to clipboard

Disable EditPage and GithubLink

Open rlueder opened this issue 7 years ago • 5 comments

Question

Description Is there a way of disabling EditPage and GithubLink on the default template? It could be as simple as setting "visibility: hidden" in the stylesheet for those components but not having used react-emotion in the past I'm not sure if I can overwrite the styles easily.

Thanks!

rlueder avatar Dec 04 '18 02:12 rlueder

I'm trying to figure this out as well.

@pedronauck is there any way to disable/hide this feature using themeConfig in the doczrc.js file?

Thanks a lot!

carolesteves avatar Dec 06 '18 10:12 carolesteves

After taking a look at the Page.tsx component one quick/dirty way to disable both EditPage and GithubLink is to remove the "repository" prop from your package.json.

EditPage and GithubLink rely on it as prop in order to render. Would still be nice to disable it with a proper config entry though...

That works fine for my project as it's a private repo, probably not a good solution for public projects.

rlueder avatar Dec 06 '18 21:12 rlueder

You may set repository: false in your doczrc.js to disable a github link.

denisborovikov avatar Dec 07 '18 10:12 denisborovikov

@denisborovikov It works to remove the github link, thanks a lot! The Edit Page link is still there though. Do you have any idea of how to hide it?

@rlueder I tested your solution and it works just fine! It would be better if we could find a way to set to false on the doczrc.js file for both EditPage and GithubLink, but if there isn't a way to do so, this is the solution I'm gonna go with in my project as well. Thanks =)

carolesteves avatar Dec 07 '18 11:12 carolesteves

As a workaround, you can set the edit property in each document to false as seen here https://github.com/pedronauck/docz/blob/84283f1d63ac40c0c1ee787db768c51945e4f79f/core/docz-theme-default/src/components/ui/Page.tsx#L71

---
name: Intro
edit: false
---

I haven't found a way to do this globally.

kirbycool avatar May 23 '19 19:05 kirbycool