Skip to content

Commit

Permalink
fix asset url resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Oct 27, 2024
1 parent b648c9b commit 097cadd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/ToucanSDK/PageBundle/PageBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct PageBundle {

let id: String
let url: URL
let baseUrl: String

let slug: String
let permalink: String
Expand Down Expand Up @@ -48,7 +49,7 @@ struct PageBundle {
return path
}
let src = String(path.dropFirst(prefix.count))
return "/" + config.assets.folder + "/" + assetsLocation + "/" + src
return baseUrl + config.assets.folder + "/" + assetsLocation + "/" + src
}

// MARK: -
Expand Down
1 change: 1 addition & 0 deletions Sources/ToucanSDK/PageBundle/PageBundleLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public struct PageBundleLoader {
return .init(
id: id,
url: dirUrl,
baseUrl: sourceConfig.site.baseUrl,
slug: slug,
permalink: slug.permalink(
baseUrl: sourceConfig.site.baseUrl
Expand Down
1 change: 1 addition & 0 deletions Sources/ToucanSDK/Renderers/HTMLRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ struct HTMLRenderer {
let finalBundle = PageBundle(
id: pageBundle.id,
url: pageBundle.url,
baseUrl: source.sourceConfig.site.baseUrl,
slug: finalSlug,
permalink: finalSlug.permalink(
baseUrl: source.sourceConfig.site.baseUrl
Expand Down

0 comments on commit 097cadd

Please sign in to comment.