spring-io / antora-ui-spring

Mozilla Public License 2.0
13 stars 26 forks source link

feat: Visual indicator for External link in the sidebar #241

Closed oodamien closed 1 month ago

oodamien commented 1 month ago

Resolves #240

For external link(s), add icon and target blank (open in a new tab)

oodamien commented 1 month ago
image
rwinch commented 1 month ago

@oodamien This looks great! I think it was @philwebb that was looking for this feature, so it is probably best to get his feedback before merging.

philwebb commented 1 month ago

It looks really nice, but I'm not sure how to go about setting external: true in our UI model. I'll need to investigate.

philwebb commented 1 month ago

I think this is the Antora code that build the navigation tree. I think we're using xref at the moment which means our url types are internal. I think we might need a new Antora extension to help set the attributes we need.

philwebb commented 1 month ago

I think we should also consider using an octicon like we do for the admonitionblock css. There's https://primer.style/foundations/icons/link-external-16 which we should be able to include if we update the generate-octicons.js script.

philwebb commented 1 month ago

I've done some work on an extension to allow us to attach attributes to the nav tree. https://github.com/spring-io/antora-extensions/pull/27.

It still needs an end-to-end test with the UI.

philwebb commented 1 month ago

We think we should hold off on merging this until we have clarity around https://github.com/spring-io/antora-extensions/pull/27#issuecomment-2108247870.

philwebb commented 1 month ago

244 provides an updated version of this PR that uses the recent role support that @rwinch pushed and octicons rather than fontawsome.

oodamien commented 1 month ago

Close in favor of https://github.com/spring-io/antora-ui-spring/pull/244