d2 icon indicating copy to clipboard operation
d2 copied to clipboard

do link needs to be fully qualified domain name (FQDN) in 0.6.9 ?

Open rhoit opened this issue 11 months ago • 2 comments

I use the d2 diagram generated SVG which is used to navigate my projects. The SVG where I use relative urls routes starting with '/', since it would be same in development or production environment. But now in new version link ignores the relative urls, last known good version was 0.6.5 is there way around this limitation.

Image

EDIT

Found the way around "/route" -> "http:/route" works but not sure about it working in https

pool: {
    shape : circle
    link : "http:/route"
}

rhoit avatar Feb 17 '25 11:02 rhoit

@rhoit

If I understand correctly, you want to link to an absolute URL from root, like

x.link: /go

The SVG is hosted on a web server. When you run this locally, it goes to http://localhost:3000/go, and when you run it in prod, it goes to https://prod.com/go. Is that right?

alixander avatar Feb 17 '25 15:02 alixander

@alixander yes that is exactly my problem.

rhoit avatar Feb 17 '25 16:02 rhoit

@alixander any updates regarding this issue? is this going to be default link handling?

rhoit avatar Mar 20 '25 02:03 rhoit

Hi @rhoit sorry for the delay, will be fixed in the next release

alixander avatar Mar 20 '25 16:03 alixander

@alixander thank you for the fix, will try build using the patch.

rhoit avatar Mar 21 '25 03:03 rhoit

yes it works! perfectly 🎊 🥳

rhoit avatar Mar 21 '25 08:03 rhoit

Thanks for testing!

alixander avatar Mar 21 '25 15:03 alixander