kit-docs icon indicating copy to clipboard operation
kit-docs copied to clipboard

Using kit-docs as subpage inside a website

Open Leomonay opened this issue 3 years ago • 2 comments

Hello! First of all, I searched for a community or forum to ask this, but I did not find one. So, please excuse me if this is not the right place where to ask.

I need to add a blog and documentation to my website. Using kit-docs for both of them. The main idea is to set the links in the navbar, next to the other website pages. I could set both documentation and blog in the same website using different sources. The problems I have now are:

  • I want to use only one navBar. I can't set the website navbar in the kit-docs pages. And I can't render a page in a different route using kit-docs navbar.
  • I also need to do a different CSS for both blog and docs. I tried using different CSS imports for each [email protected] component. But the second page clicked overwrites the CSS variables of both pages. (if you click first blog and then docs, both pages use docs styles. And vice versa).

Here I leave the link of the repository. Steps to check:

  1. Download this branch: https://gitlab.com/anagolay/blog/-/tree/1-build-blog-and-documentation-using-kitdocs
  2. pnpm install
  3. pnpm dev.
  4. Open the URL displayed at the console and click docs, then blog, and then back to docs.
  5. Go to home. Refresh. Click blog, then docs and then back to blog.

The question are:

  • What is the best way to set different styling for both kit-docs pages?
  • How can I render a single page below kit-docs navbar? or use website navbar for kit-docs pages? Thank you in advance!

Leomonay avatar Jul 29 '22 05:07 Leomonay

I've got a slightly different twist on a similar topic...

I'd like to use kitdocs as part of a svelte project to manage the docs alongside within the app - but it doesn't seem to be trivial to have kitdocs start at say "/docs" - unless I've missed something in the manual?

baradhili avatar Jan 22 '23 23:01 baradhili