Skip to content

Conversation

@d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://128397787

Summary

This fixes a bug in the navigator index where pages with custom @PageImage icons would use the wrong relative path to refer to that image within the .doccarchive.

Dependencies

None.

Testing

  • In any project, add an article with a custom page image icon (and add an image to use as the icon). For example:
# Some article

@Metadata {
    @PageImage(purpose: icon, source: "my-icon")
}

An article with a custom page image.
  • Build and preview documentation for the project.
    • The article's item in the navigator should display the custom icon

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary Not applicable

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

}
let jsonEncoder = RenderJSONEncoder.makeEncoder(
prettyPrint: shouldPrettyPrintOutputJSON,
assetPrefixComponent: bundleIdentifier.split(separator: "/").joined(separator: "-")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This asset prefix parameter configures the encoder to insert the bundle ID in the relative path for all assets.

Copy link
Contributor

@emilyychenn emilyychenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@d-ronnqvist d-ronnqvist merged commit 2809e81 into swiftlang:main May 23, 2024
@d-ronnqvist d-ronnqvist deleted the custom-navigator-icons branch May 23, 2024 13:24
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants