Skip to content

Commit

Permalink
Videos in Sitemap ermöglichen (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais authored Jan 1, 2023
1 parent de0e032 commit c6570b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions assets/xsl-stylesheets/xml-sitemap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<xsl:stylesheet version="2.0"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
Expand Down Expand Up @@ -80,9 +81,10 @@
<table id="sitemap" cellpadding="3">
<thead>
<tr>
<th width="75%">URL</th>
<th width="70%">URL</th>
<th width="5%">Priority</th>
<th width="5%">Images</th>
<th width="5%">Videos</th>
<th width="5%">Change Freq.</th>
<th width="10%">Last Change</th>
</tr>
Expand All @@ -106,6 +108,9 @@
<td>
<xsl:value-of select="count(image:image)"/>
</td>
<td>
<xsl:value-of select="count(video:video)"/>
</td>
<td>
<xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
</td>
Expand All @@ -120,4 +125,4 @@
</body>
</html>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
2 changes: 1 addition & 1 deletion lib/yrewrite/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function sendSitemap($domain = '')
header('Content-Type: application/xml');
$content = '<?xml version="1.0" encoding="UTF-8"?>';
$content .= "\n".'<?xml-stylesheet type="text/xsl" href="assets/addons/yrewrite/xsl-stylesheets/xml-sitemap.xsl"?>';
$content .= "\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
$content .= "\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">';
$content .= implode("\n", $sitemap);
$content .= "\n".'</urlset>';
echo $content;
Expand Down

0 comments on commit c6570b4

Please sign in to comment.