-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathsitemap.xsl
129 lines (129 loc) · 3.03 KB
/
sitemap.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xsl:version="3.0"
xmlns:sitemap="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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<title>Sitemap</title>
<style>
html {
color: #222;
line-height: 3;
font-family: tahoma, sans-serif;
background-color: #f8f9fa;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
dl {
margin: 5em 0 3em;
white-space: nowrap;
counter-reset: section;
}
dt {
position: fixed;
z-index: 1;
top: 0;
left: 0;
right: 0;
padding-top: 2em;
background-color: #fff;
border-bottom: 1px solid #d9e0e2;
}
dt, dd {
padding-left: 16%;
padding-right: 12%;
}
dd {
position: relative;
margin: 0;
color: #777;
border-top: 1px solid #eee;
}
dd:first-of-type {
border-top: 0;
}
dd:before {
counter-increment: section;
content: counter(section) ".";
position: absolute;
margin-left: -1em;
text-align: right;
text-indent: -2em;
}
dd:hover {
background-color: #fff;
}
div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#lastmod,
time {
float: right;
}
div div {
display: inline-block;
width: 3em;
height: 3em;
margin-right: 1em;
vertical-align: top;
background-position: top center;
background-repeat: no-repeat;
background-size: cover;
}
a {
position: relative;
color: #0f4cd5;
text-decoration: none;
outline: 0;
pointer-events: auto;
-webkit-user-drag: none;
user-drag: none;
}
a:visited {
color: #720fc5;
}
a:hover, a:focus {
text-decoration: underline;
}
dd > a {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
</style>
<dl>
<dt>
<div id="lastmod">Last modified (GMT)</div>
<div>Sitemap URL</div>
</dt>
<xsl:for-each select="sitemap:urlset/sitemap:url">
<dd>
<xsl:variable name="lastmod" select="sitemap:lastmod"/>
<xsl:variable name="url" select="sitemap:loc"/>
<xsl:variable name="image" select="image:image/image:loc"/>
<xsl:if test="string($lastmod)">
<time datetime="{$lastmod}"><xsl:value-of select="concat(substring($lastmod, 0, 5), concat('/', substring($lastmod, 6, 2)), concat('/', substring($lastmod, 9, 2)), concat(' ', substring($lastmod, 12, 5)))"/></time>
</xsl:if>
<xsl:if test="string($url)">
<a href="{$url}" tabindex="-1"></a>
</xsl:if>
<div>
<xsl:if test="string($image)">
<div style="background-image:url({$image})"></div>
</xsl:if>
<xsl:if test="string($url)">
<a href="{$url}"><xsl:value-of select="sitemap:loc"/></a>
</xsl:if>
</div>
</dd>
</xsl:for-each>
</dl>
</html>