jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
511 stars 45 forks source link

Setting Up Multi-Product Documentation URLs with MkDocs and Mike #175

Closed pramilaniroshan closed 9 months ago

pramilaniroshan commented 9 months ago

Hi all,

Thanks for the great tool.

I am currently facing an issue related to setting up multi-product documentation with the same URL structure using MkDocs and Mike. Let me explain the scenario:

We have two solutions: UEM and IOT, and we maintain documentation only for UEM, which is accessible at https://xxxxxxxx/. Now, we have a plan to add documentation for the IOT solution as well, and we want the new URL structure to look like this:

UEM: https://xxxxxxxx/uem/ IOT: https://xxxxxxxx/iot/ I have tried two different approaches to achieve this, but neither has worked.

Running two instances of mike serve on different ports and configuring Nginx to route requests to the respective ports based on the URL path.(using --dev-addr)

Changing the site_url configuration in the mkdocs.yml file to include the solution name in the URL. Unfortunately, neither has worked. I notice that site_url changes not detecting in mike. it;s only work for mkdocs serve

I would appreciate any guidance or solutions on how to achieve this using MkDocs and Mike.

Thanks.

jimporter commented 9 months ago

We have two solutions: UEM and IOT, and we maintain documentation only for UEM, which is accessible at https://xxxxxxxx/. Now, we have a plan to add documentation for the IOT solution as well, and we want the new URL structure to look like this:

UEM: https://xxxxxxxx/uem/ IOT: https://xxxxxxxx/iot/ I have tried two different approaches to achieve this, but neither has worked.

Just pass --prefix to configure the prefix directory for each of your sub-sites, e.g. mike deploy --prefix=uem SOME-VERSION. If you want to preserve your own UEM docs in the new location, then you can move them around as needed with git mv or similar on your gh-pages branch. (On the latest dev version of mike, you can also specify the prefix via the deploy_prefix field in your mkdocs.yml configuration.)

Running two instances of mike serve on different ports and configuring Nginx to route requests to the respective ports based on the URL path.(using --dev-addr)

Do not run mike serve for production. It's designed for local testing only, and it's not designed for security. (It just uses the Python stdlib HTTP server.)

pramilaniroshan commented 9 months ago

Thanks. this is working now