xref: /webtrees/resources/views/modules/sitemap/sitemap-xsl.phtml (revision 43d034fe217afe449f8b3738e61546a11e0b6554)
1a9b216ceSGreg Roach<<?php /* Beware short open tags in PHP <8.0 */ ?>?xml version="1.0" encoding="UTF-8"?>
214aabe72SGreg Roach<xsl:stylesheet version="2.0"
314aabe72SGreg Roachxmlns:html="http://www.w3.org/TR/REC-html40"
414aabe72SGreg Roachxmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
5*43d034feSGreg Roachxmlns:sitemap="https://www.sitemaps.org/schemas/sitemap/0.9"
614aabe72SGreg Roachxmlns:xsl="http://www.w3.org/1999/XSL/Transform">
714aabe72SGreg Roach    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
814aabe72SGreg Roach    <xsl:template match="/">
914aabe72SGreg Roach        <html xmlns="http://www.w3.org/1999/xhtml">
1014aabe72SGreg Roach            <head>
1114aabe72SGreg Roach                <title>XML Sitemap</title>
1214aabe72SGreg Roach                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13d2ffce16SGreg Roach                <link rel="stylesheet" href="<?= asset('css/vendor.min.css') ?>" />
1414aabe72SGreg Roach            </head>
1514aabe72SGreg Roach            <body>
1614aabe72SGreg Roach                <div class="container">
1714aabe72SGreg Roach                    <h1>XML Sitemap</h1>
1814aabe72SGreg Roach                    <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &gt; 0">
1914aabe72SGreg Roach                        <p class="expl">
2014aabe72SGreg Roach                            This XML Sitemap Index file contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps.
2114aabe72SGreg Roach                        </p>
2214aabe72SGreg Roach                        <table class="table table-sm table-bordered table-striped table-hover">
2314aabe72SGreg Roach                            <thead>
2414aabe72SGreg Roach                                <tr>
25c5a1ffe6SGreg Roach                                    <th>URL</th>
26c5a1ffe6SGreg Roach                                    <th>Updated</th>
2714aabe72SGreg Roach                                </tr>
2814aabe72SGreg Roach                            </thead>
2914aabe72SGreg Roach                            <tbody>
3014aabe72SGreg Roach                                <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
3114aabe72SGreg Roach                                    <xsl:variable name="sitemapURL">
3214aabe72SGreg Roach                                        <xsl:value-of select="sitemap:loc"/>
3314aabe72SGreg Roach                                    </xsl:variable>
3414aabe72SGreg Roach                                    <tr>
3514aabe72SGreg Roach                                        <td>
3614aabe72SGreg Roach                                            <a href="{$sitemapURL}"><xsl:value-of select="sitemap:loc"/></a>
3714aabe72SGreg Roach                                        </td>
3814aabe72SGreg Roach                                        <td>
3914aabe72SGreg Roach                                            <xsl:value-of select="sitemap:lastmod"/>
4014aabe72SGreg Roach                                        </td>
4114aabe72SGreg Roach                                    </tr>
4214aabe72SGreg Roach                                </xsl:for-each>
4314aabe72SGreg Roach                            </tbody>
4414aabe72SGreg Roach                        </table>
4514aabe72SGreg Roach                    </xsl:if>
4614aabe72SGreg Roach                    <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &lt; 1">
4714aabe72SGreg Roach                        <p class="expl">
4814aabe72SGreg Roach                            This XML Sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
4914aabe72SGreg Roach                        </p>
5014aabe72SGreg Roach                        <table class="table table-sm table-bordered table-striped table-hover">
5114aabe72SGreg Roach                            <thead>
5214aabe72SGreg Roach                                <tr>
53c5a1ffe6SGreg Roach                                    <th>URL</th>
54c5a1ffe6SGreg Roach                                    <th>Priority</th>
55c5a1ffe6SGreg Roach                                    <th>Updated</th>
5614aabe72SGreg Roach                                </tr>
5714aabe72SGreg Roach                            </thead>
5814aabe72SGreg Roach                            <tbody>
5914aabe72SGreg Roach                                <xsl:for-each select="sitemap:urlset/sitemap:url">
6014aabe72SGreg Roach                                    <tr>
6114aabe72SGreg Roach                                        <td>
6214aabe72SGreg Roach                                            <xsl:variable name="itemURL">
6314aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
6414aabe72SGreg Roach                                            </xsl:variable>
6514aabe72SGreg Roach                                            <a href="{$itemURL}">
6614aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
6714aabe72SGreg Roach                                            </a>
6814aabe72SGreg Roach                                        </td>
6914aabe72SGreg Roach                                        <td>
70c5a1ffe6SGreg Roach                                            <xsl:value-of select="sitemap:priority"/>
71c5a1ffe6SGreg Roach                                        </td>
72c5a1ffe6SGreg Roach                                        <td>
7314aabe72SGreg Roach                                            <xsl:value-of select="sitemap:lastmod"/>
7414aabe72SGreg Roach                                        </td>
7514aabe72SGreg Roach                                    </tr>
7614aabe72SGreg Roach                                </xsl:for-each>
7714aabe72SGreg Roach                            </tbody>
7814aabe72SGreg Roach                        </table>
7914aabe72SGreg Roach                    </xsl:if>
8014aabe72SGreg Roach                </div>
8114aabe72SGreg Roach            </body>
8214aabe72SGreg Roach        </html>
8314aabe72SGreg Roach    </xsl:template>
8414aabe72SGreg Roach</xsl:stylesheet>
85