Doctave / doctave

A batteries-included developer documentation site generator
https://cli.doctave.com
MIT License
549 stars 33 forks source link

Possibly doctave resolves paths incorrectly #11

Closed ales-tsurko closed 2 years ago

ales-tsurko commented 2 years ago

Hi!

I tried to build a site using doctave and here's what I get: https://alestsurko.by/kotoist/

Check out the console.

The repo is here: https://github.com/ales-tsurko/kotoist

I've added .nojekyll and CNAME. Without CNAME I had the same result.

begleynk commented 2 years ago

Hi there! Thanks for taking the time to report this.

I'm pretty sure this because the site is not being served from the root of the URL. Unfortunately this is something that Doctave as of right now does not support.

The good news is that a feature request for this was opened a few days ago and this feature will be coming in the next release!

You can expect a 0.3.0 release within a day or two, after which a quick addition to your doctave.yaml file should fix the issue.

ales-tsurko commented 2 years ago

Ah ok. Thanks! Will wait then.

begleynk commented 2 years ago

The 0.3.0 release is out now with support for serving the site from a non-root path. Could you give that a go and see if that solves your issue?

Relevant documentation about how to use the feature can be found in the documentation.

I'm going to close this ticket for now, but feel free to reopen or create a new issue if you run into any problems.

ales-tsurko commented 2 years ago

Thanks! It's better, but search doesn't work.

Here's the output in the console related to doctave:

doctave-app.js?v=1634831097:151 GET https://alestsurko.by/search_index.json 404
(anonymous) @ doctave-app.js?v=1634831097:151
doctave-app.js?v=1634831097:130 GET https://alestsurko.by/assets/prism-ghcolors.css?1634831097 net::ERR_ABORTED 404
setColor @ doctave-app.js?v=1634831097:130
(anonymous) @ doctave-app.js?v=1634831097:207
doctave-app.js?v=1634831097:154 Uncaught (in promise) Error: HTTP error 404
    at doctave-app.js?v=1634831097:154
ciwchris commented 2 years ago

Another nice addition would be to optionally include the base path when running the local server. The path is only needed when deploying to a server, at least for my use case.

begleynk commented 2 years ago

Bummer - apologies for that. I'll release a 0.3.1 patch today.

@ciwchris, just so I understand correctly, do you mean you'd expected the path to not change with base_path when running locally via serve? Only for the deployment for sites created with build? My reasoning for using it locally was just to make it super clear that this is how the URLs will look once deployed. I could imagine someone getting confused trying to use the base_path config locally and thinking it does not work if they don't see the change reflected by the local server.

begleynk commented 2 years ago

Ok release 0.3.1 is now available and fixes the search issue. Thanks again for taking the time to report the bug!

ciwchris commented 2 years ago

Thanks, that solves the issue. Although now IIS doesn't like have the .html file extension missing. 😦

Regarding the base_path, correct, my preference is not to have to replicate the web server path in the repo. Thinking about it I believe most tools provide the base path as an option to the build. So maybe something like doctave build --release --base-path /my/path would work. But please do support what you prefer.

begleynk commented 2 years ago

@ciwchris I actually really like that suggestion of passing the base path as part of the build step instead of the doctave.yaml. We could add that as another option in a later release and keep the parameter also in the config file for backwards compatibility.

Did you get IIS to serve the extensionless paths? I'm not familiar with it myself but I'd imagine there's a config you can tweak? Feel free to email me at nik@doctave.com if you need any help.