Files
umed/web/public/sitemap.xsl
T
2026-07-09 14:35:32 +08:00

118 lines
3.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
>
<xsl:output method="html" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>XML Sitemap</title>
<style>
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
background: #f4fafb;
color: #1f2937;
}
.wrap {
max-width: 1100px;
margin: 0 auto;
padding: 32px 20px 48px;
}
h1 {
margin: 0 0 8px;
font-size: 1.75rem;
}
p {
margin: 0 0 24px;
color: #64748b;
line-height: 1.6;
}
table {
width: 100%;
border-collapse: collapse;
background: #fff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
th,
td {
padding: 12px 14px;
border-bottom: 1px solid #e2e8f0;
text-align: left;
vertical-align: top;
font-size: 14px;
}
th {
background: #0d9488;
color: #fff;
font-weight: 600;
}
tr:last-child td {
border-bottom: none;
}
a {
color: #0d9488;
word-break: break-all;
}
.alt {
display: block;
margin-top: 4px;
font-size: 12px;
color: #64748b;
}
</style>
</head>
<body>
<div class="wrap">
<h1>XML Sitemap</h1>
<p>
This file is for search engines. Human-friendly sitemap:
<a href="/sitemap">/sitemap</a>
</p>
<table>
<thead>
<tr>
<th>URL</th>
<th>Last Modified</th>
<th>Change Frequency</th>
<th>Priority</th>
<th>Alternate Languages</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="s:urlset/s:url">
<tr>
<td>
<a href="{s:loc}">
<xsl:value-of select="s:loc" />
</a>
</td>
<td><xsl:value-of select="s:lastmod" /></td>
<td><xsl:value-of select="s:changefreq" /></td>
<td><xsl:value-of select="s:priority" /></td>
<td>
<xsl:for-each select="xhtml:link">
<span class="alt">
<xsl:value-of select="@hreflang" />:
<a href="{@href}"><xsl:value-of select="@href" /></a>
</span>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>