swift-doc icon indicating copy to clipboard operation
swift-doc copied to clipboard

Error to load CSS in Index.html [Fix] [CSS]

Open TiagoSAmaral opened this issue 3 years ago • 2 comments

Hi! I believe there is an error generating the path to the 'all.css' file. A '/' is being placed at the very beginning, and this is not allowing it to be properly loaded into index.html.

Result after build documentation: <link rel="stylesheet" type="text/css" href="/all.css" media="all" />

Expected result: <link rel="stylesheet" type="text/css" href="all.css" media="all" />

TiagoSAmaral avatar Jul 30 '21 03:07 TiagoSAmaral

I also encountered a similar problem, how can I solve this problem? Thank you

quntion avatar Aug 20 '21 06:08 quntion

This is not a bug and working as intended. The generated HTML files are intended to be hosted by a web server. Opening the files from the local file system is not supported. See also #174 for a more detailed discussion.

However, please have a look into the --base-url option. Setting this flag might already solve your problem.

Lukas-Stuehrk avatar Aug 26 '21 21:08 Lukas-Stuehrk