Skip to content

Commit

Permalink
Implicitly add a trailing slash to hostedBaseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed May 5, 2024
1 parent 2f8d909 commit 84e4b85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -52,6 +52,7 @@
- `@license` and `@import` comments will be ignored at the top of files, #2552.
- Fixed issue in documentation validation where constructor signatures where improperly considered not documented, #2553.
- Fixed issue where search results could not be navigated while Windows Narrator was on, #2563.
- `--hostedBaseUrl` will now implicitly add a trailing slash to the generated URL.

### Thanks!

Expand Down
6 changes: 4 additions & 2 deletions src/lib/output/plugins/SitemapPlugin.ts
Expand Up @@ -8,8 +8,10 @@ import { Fragment } from "../../utils/jsx";

@Component({ name: "sitemap" })
export class SitemapPlugin extends RendererComponent {
@Option("hostedBaseUrl")
accessor hostedBaseUrl!: string;
private get hostedBaseUrl() {
const url = this.application.options.getValue("hostedBaseUrl");
return url.endsWith("/") ? url : url + "/";
}

override initialize() {
this.listenTo(this.owner, RendererEvent.BEGIN, this.onRendererBegin);
Expand Down

0 comments on commit 84e4b85

Please sign in to comment.