outmoded / lout

API documentation generator
Other
276 stars 49 forks source link

Make CSS path relative. #61

Closed gergoerdosi closed 10 years ago

gergoerdosi commented 10 years ago

We have hapi in a subdirectory (https://api.example.com/v1). With the default configuration lout sets the endpoint to /docs making the documentation available at https://api.example.com/v1/docs. The problem is that this same endpoint (/docs) is used for the CSS path, which results in a link:

<link href="/docs/css/style.css" rel="stylesheet">

This link expands to https://api.example.com/docs/css/style.css which results in 404 (/v1 is missing in the URL). So I propose to make the CSS path relative to the endpoint route. If endpoint is /docs, then set CSS path to docs. Then link will become:

<link href="docs/css/style.css" rel="stylesheet">

This expands to https://api.example.com/v1/docs/css/style.css which is the correct URL.

gergoerdosi commented 10 years ago

Closing this PR in favor of #63 .