## We tried to use the linkx plugin to load directly the attached CSS file but there is no option to parse the content. ## We do this hack instead. #set($css = $doc.getAttachment('tree.min.css').contentAsString) ## We need to update the base image path. It's not empty by default because the path to the actual CSS file is specified
## in the query string of a WebJar URL which means it cannot be used to resolve the relative images. But even if the
## base image path were empty, we would still need to set it because we load the CSS using the ssx action while the
## images need the download action.
#set ($webjarImagePath = '$!services.webjars.url(''org.xwiki.platform:xwiki-platform-tree-webjar'','''')')
## HACK: We assume the attachment name is the last segment in the URL but it depends on the URL scheme.
#set ($attachmentImagePath = $stringtool.removeEnd($doc.getAttachmentURL('__attachment__'), '__attachment__')) #evaluate($css.replace($webjarImagePath,$attachmentImagePath))