Skip to content

Commit

Permalink
🐛 fix(feed): load CSS in subfolder setups
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Jan 18, 2025
1 parent 0e0a391 commit 1fc2423
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion static/feed_style.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
<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"/>
<link rel="stylesheet" href="{/atom:feed/@xml:base}/main.css"/>
<!-- 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"/>
<link rel="stylesheet" href="{/atom:feed/atom:link[@rel='extra-stylesheet']/@href}" />

</head>
Expand Down

0 comments on commit 1fc2423

Please sign in to comment.