forked from deepStateMirrors/tabi
🐛 fix(feed): styling now works in all website paths
The feed's stylesheet now uses the base URL from Zola's configuration, ensuring correct stylesheet loading in all contexts (root path, subdirectories, and subdomains). Previously, the stylesheet URLs could break when feeds were in subdirectories.
This commit is contained in:
parent
402965786b
commit
45fe170467
2 changed files with 3 additions and 7 deletions
|
@ -14,13 +14,8 @@
|
|||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<!-- The base URL is assumed to be the first URL in the sitemap. -->
|
||||
<xsl:variable name="baseUrl" select="(sitemap:urlset/sitemap:url)[1]/sitemap:loc"/>
|
||||
<!-- Remove http[s]:// -->
|
||||
<xsl:variable name="baseUrlWithoutProtocol" select="substring-after($baseUrl, '://')"/>
|
||||
<!-- Remove trailing slash -->
|
||||
<xsl:variable name="clean_base_url" select="substring-before($baseUrlWithoutProtocol, '/')"/>
|
||||
<link rel="stylesheet" href="{$baseUrl}main.css"/>
|
||||
<xsl:variable name="baseUrl" select="/atom:feed/tabi:metadata/tabi:base_url"/>
|
||||
<link rel="stylesheet" href="{$baseUrl}/main.css"/>
|
||||
<link rel="stylesheet" href="{/atom:feed/atom:link[@rel='extra-stylesheet']/@href}" />
|
||||
|
||||
</head>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue