Linking from and to Walrus Sites
This feature is currently unavailable on server-side portals. If you are browsing a Walrus Site on https://wal.app, you are not able to use Walrus Sites links.
Certain types of links on Walrus Sites work differently than on a regular website.
Same behavior
-
Linking to resources within the same site: Relative and absolute links (
href="/path/to/resource.html") work as usual. -
Linking to a resource on the web (
href="https://some.cdn.example.com/stylesheet.css"): Works as usual.
Different behavior
- Linking to resources in other Walrus Sites: Must use the Walrus Site links feature.
Assume there is some image that you can browse at https://gallery.wal.app/walrus_arctic.webp, and you want to link it from your own Walrus Site. https://wal.app is just one of many portals. The same resource is browsable from a local portal (http://gallery.localhost:8080/walrus_arctic.webp). Therefore, how can you link the resource in a portal-independent way? This is important for interoperability, availability, and respecting the user's choice of portal.
This problem is solved by having the portals interpret special links that are normally invalid on the web and redirect to the corresponding Walrus Sites resource in the portal itself.
Using Walrus Site links
Consider the example above, where the resource /walrus_arctic.webp is browsed from the Walrus Site with SuiNS name gallery, which points to the object ID abcd123… (in Base36 encoding). Then, the portal-independent link is: https://gallery.suiobj/walrus_arctic.webp. To fix the object ID instead of the SuiNS name, you can use https://abcd123….suiobj/walrus_arctic.webp.
Another possibility is to directly point to the Walrus blob ID of the resource, and have the browser "sniff" the content type. This works for images, for example, but not for script or stylesheets. For example to point to the blob ID (for example, containing an image) qwer5678…, use the URL https://blobid.walrus/qwer5678….
With such a link, the portal extracts the blob ID and redirects the request to the aggregator it is using to fetch blobs.