Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the output relocatable #112

Closed
github-nilsson opened this issue Jul 1, 2022 · 4 comments
Closed

Make the output relocatable #112

github-nilsson opened this issue Jul 1, 2022 · 4 comments

Comments

@github-nilsson
Copy link

The current output can't be moved into any subdirectory of a webserver due to the use of this.baseURL. Everything javascript-based, like search, is easily solved using document.location instead.

     <script>
       // Global variables
-      var baseURL = "<?js= this.baseURL ?>"
+      var baseURL = document.location.pathname;
+      baseURL = baseURL.substr(0,baseURL.lastIndexOf("/")+1);
     </script>

The use of this.baseURL in sidebar-title.tmpl must also be changed.

@ankitskvmdam
Copy link
Owner

Hi @github-nilsson, the purpose of this.baseURL is to set the base URL for the output. So, let's say the domain name is https://example.com and we are placing our doc/output to /docs/v1, the the value of the this.baseURL should be https://example.com/docs/v1/.

@github-nilsson
Copy link
Author

Yes, but that isn't a good solution as you can't move it to a different directory, and you have to build multiple times if you wan to publish the documentation in multiple places.

@ankitskvmdam
Copy link
Owner

Yes, that is true. What do you think about this: I will set the default value of this.baseURL as what you have suggested, and later if we find that there is no need for this.baseURL then we will remove it.

Thanks for this insight.

@ankitskvmdam
Copy link
Owner

Fix: 6bb193a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants