Skip to content

Commit

Permalink
Fix: use full URL for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
simar0at committed Oct 17, 2023
1 parent 98fddbf commit 8fdeb41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion vicav.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ declare function vicav:_get_text($id as xs:string, $xsltfn as xs:string?) {
let $stylePath := file:base-dir() || 'xslt/' || $xsltfn
let $style := doc($stylePath)
let $sHTML := xslt:transform-text($results, $style, map{
'param-images-base-path': replace(util:get-base-uri-public()||'/images', '/text', ''),
'param-base-path': replace(util:get-base-uri-public(), '/text', ''),
'tei-link-marker': xs:string($generateTeiMarker)})
return $sHTML
};
Expand Down
21 changes: 12 additions & 9 deletions xslt/vicavTexts.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@
<xsl:output method="html" encoding="UTF-8"/>
<xsl:param name="tei-link-marker" select="'false'" as="xs:string"/>
<!-- the path under which images are served frome the webapplication. The XQuery function that handles such requests is defined in http.xqm -->
<xsl:param name="param-images-base-path">images</xsl:param>
<xsl:param name="param-base-path">images</xsl:param>
<!-- we make sure that $images-base-path always has a trailing slash -->
<xsl:variable name="images-base-path">
<xsl:function name="tei:concat-path" as="xs:string">
<xsl:param name="subdir" as="xs:string"/>
<xsl:choose>
<xsl:when test="$param-images-base-path = ''"/>
<xsl:when test="$param-base-path = ''"/>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="substring(normalize-space($param-images-base-path),string-length(normalize-space($param-images-base-path)),1) = '/'">
<xsl:value-of select="$param-images-base-path"/>
<xsl:when test="$subdir = '' or substring(normalize-space($param-base-path),string-length(normalize-space($param-base-path)),1) = '/'">
<xsl:value-of select="concat($param-base-path,$subdir,'/')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($param-images-base-path,'/')"/>
<xsl:value-of select="concat($param-base-path,'/',$subdir,'/')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:choose>
</xsl:function>
<xsl:variable name="images-base-path" select="tei:concat-path('images')"/>
<xsl:variable name="docs-base-path" select="tei:concat-path('')"/>
<xsl:include href="vicavIDToLabel.xslt"/>

<xsl:variable name="openDictFuncToDictID" select='map{
Expand Down Expand Up @@ -322,7 +325,7 @@

<xsl:template match="tei:ref">
<a target="_blank" class="aVicText">
<xsl:attribute name="href"><xsl:value-of select="@target"/></xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$docs-base-path||@target"/></xsl:attribute>
<xsl:sequence select='tei:getLinkAttributes(@target)'/>
<xsl:apply-templates/>
</a>
Expand Down

0 comments on commit 8fdeb41

Please sign in to comment.