xref: /webtrees/resources/views/modules/sitemap/sitemap-xsl.phtml (revision a9b216cea106cf1196df0c1c08a9fa5bd71780c2)
1*a9b216ceSGreg 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"
514aabe72SGreg Roachxmlns:sitemap="http://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" />
1314aabe72SGreg Roach                <link rel="stylesheet" href="<?= asset('css/vendor.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>
2514aabe72SGreg Roach                                    <th class="w-75">URL</th>
2614aabe72SGreg Roach                                    <th class="w-25">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>
5314aabe72SGreg Roach                                    <th class="w-75">URL</th>
5414aabe72SGreg Roach                                    <th class="w-25">Updated</th>
5514aabe72SGreg Roach                                </tr>
5614aabe72SGreg Roach                            </thead>
5714aabe72SGreg Roach                            <tbody>
5814aabe72SGreg Roach                                <xsl:for-each select="sitemap:urlset/sitemap:url">
5914aabe72SGreg Roach                                    <tr>
6014aabe72SGreg Roach                                        <td>
6114aabe72SGreg Roach                                            <xsl:variable name="itemURL">
6214aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
6314aabe72SGreg Roach                                            </xsl:variable>
6414aabe72SGreg Roach                                            <a href="{$itemURL}">
6514aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
6614aabe72SGreg Roach                                            </a>
6714aabe72SGreg Roach                                        </td>
6814aabe72SGreg Roach                                        <td>
6914aabe72SGreg Roach                                            <xsl:value-of select="sitemap:lastmod"/>
7014aabe72SGreg Roach                                        </td>
7114aabe72SGreg Roach                                    </tr>
7214aabe72SGreg Roach                                </xsl:for-each>
7314aabe72SGreg Roach                            </tbody>
7414aabe72SGreg Roach                        </table>
7514aabe72SGreg Roach                    </xsl:if>
7614aabe72SGreg Roach                </div>
7714aabe72SGreg Roach            </body>
7814aabe72SGreg Roach        </html>
7914aabe72SGreg Roach    </xsl:template>
8014aabe72SGreg Roach</xsl:stylesheet>
81