xref: /webtrees/resources/views/modules/sitemap/sitemap-xsl.phtml (revision 14aabe72532c2be0de4e4de0307f9c27f2d4dab8)
1*14aabe72SGreg Roach<?xml version="1.0" encoding="UTF-8"?>
2*14aabe72SGreg Roach<xsl:stylesheet version="2.0"
3*14aabe72SGreg Roachxmlns:html="http://www.w3.org/TR/REC-html40"
4*14aabe72SGreg Roachxmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
5*14aabe72SGreg Roachxmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
6*14aabe72SGreg Roachxmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7*14aabe72SGreg Roach    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8*14aabe72SGreg Roach    <xsl:template match="/">
9*14aabe72SGreg Roach        <html xmlns="http://www.w3.org/1999/xhtml">
10*14aabe72SGreg Roach            <head>
11*14aabe72SGreg Roach                <title>XML Sitemap</title>
12*14aabe72SGreg Roach                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13*14aabe72SGreg Roach                <link rel="stylesheet" href="<?= asset('css/vendor.css') ?>" />
14*14aabe72SGreg Roach            </head>
15*14aabe72SGreg Roach            <body>
16*14aabe72SGreg Roach                <div class="container">
17*14aabe72SGreg Roach                    <h1>XML Sitemap</h1>
18*14aabe72SGreg Roach                    <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &gt; 0">
19*14aabe72SGreg Roach                        <p class="expl">
20*14aabe72SGreg Roach                            This XML Sitemap Index file contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps.
21*14aabe72SGreg Roach                        </p>
22*14aabe72SGreg Roach                        <table class="table table-sm table-bordered table-striped table-hover">
23*14aabe72SGreg Roach                            <thead>
24*14aabe72SGreg Roach                                <tr>
25*14aabe72SGreg Roach                                    <th class="w-75">URL</th>
26*14aabe72SGreg Roach                                    <th class="w-25">Updated</th>
27*14aabe72SGreg Roach                                </tr>
28*14aabe72SGreg Roach                            </thead>
29*14aabe72SGreg Roach                            <tbody>
30*14aabe72SGreg Roach                                <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
31*14aabe72SGreg Roach                                    <xsl:variable name="sitemapURL">
32*14aabe72SGreg Roach                                        <xsl:value-of select="sitemap:loc"/>
33*14aabe72SGreg Roach                                    </xsl:variable>
34*14aabe72SGreg Roach                                    <tr>
35*14aabe72SGreg Roach                                        <td>
36*14aabe72SGreg Roach                                            <a href="{$sitemapURL}"><xsl:value-of select="sitemap:loc"/></a>
37*14aabe72SGreg Roach                                        </td>
38*14aabe72SGreg Roach                                        <td>
39*14aabe72SGreg Roach                                            <xsl:value-of select="sitemap:lastmod"/>
40*14aabe72SGreg Roach                                        </td>
41*14aabe72SGreg Roach                                    </tr>
42*14aabe72SGreg Roach                                </xsl:for-each>
43*14aabe72SGreg Roach                            </tbody>
44*14aabe72SGreg Roach                        </table>
45*14aabe72SGreg Roach                    </xsl:if>
46*14aabe72SGreg Roach                    <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &lt; 1">
47*14aabe72SGreg Roach                        <p class="expl">
48*14aabe72SGreg Roach                            This XML Sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
49*14aabe72SGreg Roach                        </p>
50*14aabe72SGreg Roach                        <table class="table table-sm table-bordered table-striped table-hover">
51*14aabe72SGreg Roach                            <thead>
52*14aabe72SGreg Roach                                <tr>
53*14aabe72SGreg Roach                                    <th class="w-75">URL</th>
54*14aabe72SGreg Roach                                    <th class="w-25">Updated</th>
55*14aabe72SGreg Roach                                </tr>
56*14aabe72SGreg Roach                            </thead>
57*14aabe72SGreg Roach                            <tbody>
58*14aabe72SGreg Roach                                <xsl:for-each select="sitemap:urlset/sitemap:url">
59*14aabe72SGreg Roach                                    <tr>
60*14aabe72SGreg Roach                                        <td>
61*14aabe72SGreg Roach                                            <xsl:variable name="itemURL">
62*14aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
63*14aabe72SGreg Roach                                            </xsl:variable>
64*14aabe72SGreg Roach                                            <a href="{$itemURL}">
65*14aabe72SGreg Roach                                                <xsl:value-of select="sitemap:loc"/>
66*14aabe72SGreg Roach                                            </a>
67*14aabe72SGreg Roach                                        </td>
68*14aabe72SGreg Roach                                        <td>
69*14aabe72SGreg Roach                                            <xsl:value-of select="sitemap:lastmod"/>
70*14aabe72SGreg Roach                                        </td>
71*14aabe72SGreg Roach                                    </tr>
72*14aabe72SGreg Roach                                </xsl:for-each>
73*14aabe72SGreg Roach                            </tbody>
74*14aabe72SGreg Roach                        </table>
75*14aabe72SGreg Roach                    </xsl:if>
76*14aabe72SGreg Roach                </div>
77*14aabe72SGreg Roach            </body>
78*14aabe72SGreg Roach        </html>
79*14aabe72SGreg Roach    </xsl:template>
80*14aabe72SGreg Roach</xsl:stylesheet>
81