Skip to content

Images from Swift Package librairies to display in web pages have bad path #1284

@pylapp

Description

@pylapp

Description

The project is a Swift package exposing several librairies.
Each library has its own DocC markup file and a resources folder with images to add in documentation.
These images appear in the Xcode documentation viewer and also in the built documentation from Xcode (i.e. dedicated Xcode window).

However, when this documentation is built for a static web site, with the combined target experimental features gathering all documentation of all librairies for my Swift package, I face the following issues: the images do not appear in the web pages as the files are not loaded

The command:

swift package \
    --allow-writing-to-directory "$DOCUMENTATION_HTML_LOCATION" \
    generate-documentation \
    --enable-experimental-combined-documentation \
    --target OUDS \
    --target OUDSModules \
    --target OUDSComponents \
    --target OUDSThemesOrange \
    --target OUDSThemesOrangeInverse \
    --target OUDSThemesOrangeBusinessTools \
    --target OUDSThemesSosh \
    --target OUDSThemesWireframe \
    --target OUDSTokensComponent \
    --target OUDSTokensSemantic \
    --target OUDSTokensRaw \
    --target OUDSFoundations \
    --output-path "$DOCUMENTATION_HTML_LOCATION" \
    --transform-for-static-hosting \
    --warnings-as-errors \
    --symbol-graph-minimum-access-level public

The issue

For example, given my landing page, I spot in the web browser console the following 404 error traces in the attachment below

Image

For example, my page tried to load an image at https://ios.unified-design-system.orange.com/images/ic_modular.svg, however the expected URL should be https://ios.unified-design-system.orange.com/images/OUDSModules/ic_modular.svg.

For this case the folder of the library, here OUDSModules is ignored and the tool tries to load images from root images folder it generates.

Not sure if related to #1257

Resources

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

Load the URL with the expected path

Actual behavior

The path is not the expected one, imaes are searched in a bad location, library folder is missing

Steps To Reproduce

  • macOS Sequoia 15.6
  • Xcode 16.2

Swift-DocC Version Information

I do not know of to get it

Swift Compiler Version Information

swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: x86_64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions