orchidhq / Orchid

Build and deploy beautiful documentation sites that grow with you
https://orchid.run
GNU General Public License v3.0
514 stars 53 forks source link

Theme asset URLs getting creating with null/ prefix #294

Closed singularsyntax closed 5 years ago

singularsyntax commented 5 years ago

Hello,

Orchid is creating incorrect URLs for assets for the Copper theme:

<!-- start:debug info -->

<!-- THEME -->
<!-- Type: Copper -->
<!-- Class: com.eden.orchid.copper.CopperTheme -->

<!-- PAGE -->
<!-- Type: frontPage -->
<!-- Class: com.eden.orchid.api.theme.pages.OrchidPage -->
<!-- Layout: index -->
<!-- Resolved Layout: templates/layouts/index.peb -->
<!-- Page Template: frontPage, page -->
<!-- Resolved Page Template:  -->

<!-- RESOURCE -->
<!-- Class: com.eden.orchid.api.resources.resource.FileResource -->
<!-- Source Filename: homepage.md -->

<!-- COMPLETE PAGE CONFIGURATION -->
<script>
    window.allData = {"reference":{"path":"","baseUrl":"null","fileName":"","extension":"html","usePrettyUrl":true,"link":"null"},"description":"","title":"Homepage"};
</script>

<!-- end:debug info -->

<!-- start:inject styles -->
<link rel="stylesheet" type="text/css" href="null/Copper/5b4d6a27/assets/css/bulma.css"/>
<link rel="stylesheet" type="text/css" href="null/Copper/5b4d6a27/assets/css/extraCss.css"/>
<link rel="stylesheet" type="text/css" href="null/Copper/5b4d6a27/assets/css/bulma-tooltip.css"/>
<link rel="stylesheet" type="text/css" href="null/Copper/5b4d6a27/assets/css/bulma-accordion.min.css"/>
<!-- end:inject styles -->

These URLs, of course, do not exist, so the page does not get styled.

Please let me know what other debugging information I should provide.

Thanks.

cjbrooks12 commented 5 years ago

Seems like the base URL is explicitly (probably accidentally) being set to null in the build script or within the build tool plugins. Do you have a base URL set in your build script (build.gradle, pom.xml, or kscript script)?

singularsyntax commented 5 years ago

No, as the Maven template POM indicates that it is optional:

<!-- The following properties are optional -->
<version>${project.version}</version>
<baseUrl>${baseUrl}</baseUrl>                        <!-- a baseUrl prepended to all generated links. Defaults to '/' -->
singularsyntax commented 5 years ago

If I set baseUrl to '/', it still doesn't work (though the asset URLs are rendered as absolute but without scheme/port/etc.). If I set it to the full production deployment URL (with scheme/domain/port), it works.

cjbrooks12 commented 5 years ago

It should be optional, that's a bug with the Maven runner. I'll get a fix released for this tonight or tomorrow.

cjbrooks12 commented 5 years ago

This issue has been resolved and is available in 0.17.2, thanks for reporting it!