Sitemaps: Add wrapping `<div>` around sitemap in stylesheet.

This makes it easier to style the sitemap and for example center the entire content area.

Props ramiy.
Fixes #50622.

git-svn-id: https://develop.svn.wordpress.org/trunk@48471 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2020-07-14 11:43:54 +00:00
parent cf4897f5d8
commit 649b7aae92
1 changed files with 58 additions and 54 deletions

View File

@ -91,45 +91,47 @@ class WP_Sitemaps_Stylesheet {
</style> </style>
</head> </head>
<body> <body>
<div id="sitemap__header"> <div id="sitemap">
<h1>{$title}</h1> <div id="sitemap__header">
<p>{$description}</p> <h1>{$title}</h1>
<p>{$learn_more}</p> <p>{$description}</p>
</div> <p>{$learn_more}</p>
<div id="sitemap__content"> </div>
<p class="text">{$text}</p> <div id="sitemap__content">
<table id="sitemap__table"> <p class="text">{$text}</p>
<thead> <table id="sitemap__table">
<tr> <thead>
<th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod">
<th class="lastmod">{$lastmod}</th>
</xsl:if>
<xsl:if test="\$has-changefreq">
<th class="changefreq">{$changefreq}</th>
</xsl:if>
<xsl:if test="\$has-priority">
<th class="priority">{$priority}</th>
</xsl:if>
</tr>
</thead>
<tbody>
<xsl:for-each select="sitemap:urlset/sitemap:url">
<tr> <tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td> <th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod"> <xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td> <th class="lastmod">{$lastmod}</th>
</xsl:if> </xsl:if>
<xsl:if test="\$has-changefreq"> <xsl:if test="\$has-changefreq">
<td class="changefreq"><xsl:value-of select="sitemap:changefreq" /></td> <th class="changefreq">{$changefreq}</th>
</xsl:if> </xsl:if>
<xsl:if test="\$has-priority"> <xsl:if test="\$has-priority">
<td class="priority"><xsl:value-of select="sitemap:priority" /></td> <th class="priority">{$priority}</th>
</xsl:if> </xsl:if>
</tr> </tr>
</xsl:for-each> </thead>
</tbody> <tbody>
</table> <xsl:for-each select="sitemap:urlset/sitemap:url">
<tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
<xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
</xsl:if>
<xsl:if test="\$has-changefreq">
<td class="changefreq"><xsl:value-of select="sitemap:changefreq" /></td>
</xsl:if>
<xsl:if test="\$has-priority">
<td class="priority"><xsl:value-of select="sitemap:priority" /></td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</div> </div>
</body> </body>
</html> </html>
@ -199,33 +201,35 @@ XSL;
</style> </style>
</head> </head>
<body> <body>
<div id="sitemap__header"> <div id="sitemap">
<h1>{$title}</h1> <div id="sitemap__header">
<p>{$description}</p> <h1>{$title}</h1>
<p>{$learn_more}</p> <p>{$description}</p>
</div> <p>{$learn_more}</p>
<div id="sitemap__content"> </div>
<p class="text">{$text}</p> <div id="sitemap__content">
<table id="sitemap__table"> <p class="text">{$text}</p>
<thead> <table id="sitemap__table">
<tr> <thead>
<th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod">
<th class="lastmod">{$lastmod}</th>
</xsl:if>
</tr>
</thead>
<tbody>
<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
<tr> <tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td> <th class="loc">{$url}</th>
<xsl:if test="\$has-lastmod"> <xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td> <th class="lastmod">{$lastmod}</th>
</xsl:if> </xsl:if>
</tr> </tr>
</xsl:for-each> </thead>
</tbody> <tbody>
</table> <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
<tr>
<td class="loc"><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc" /></a></td>
<xsl:if test="\$has-lastmod">
<td class="lastmod"><xsl:value-of select="sitemap:lastmod" /></td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</div> </div>
</body> </body>
</html> </html>