Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jan 6, 2016
2 parents 4199bd1 + fa5e94a commit 671a735
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v1.5.0
## 01/06/2016

1. [](#new)
* Added a default XSL file for the sitemap
1. [](#improved)
* Added a note to the README on how to only allow the link to the .xml sitemap
1. [](#bugfix)
* Fixed saving the `priority` option when adding it to a page through the Admin Plugin

# v1.4.2
## 11/11/2015

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ ignores:
```

You can ignore your own pages by providing a list of routes to ignore.

## Only allow access to the .xml file

If you want your sitemap to only be accessible via `sitemap.xml` for example, set the route to `/sitemap` and add this to your `.htaccess` file:

`Redirect 301 /sitemap /sitemap.xml`
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Sitemap
version: 1.4.2
version: 1.5.0
description: "Provide automatically generated **XML sitemaps** with this very useful, but simple to configure, Grav plugin."
icon: map-marker
author:
Expand Down
2 changes: 1 addition & 1 deletion blueprints/sitemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ form:
'0.9': 0.9
'1.0': 1.0
validate:
type: float
type: string
29 changes: 29 additions & 0 deletions sitemap.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9"
exclude-result-prefixes="s"
>
<xsl:template match="/">
<html>
<body>
<h2>Sitemap</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Location</th>
<th>Last Modified</th>
<th>Update Frequency</th>
<th>Priority</th>
</tr>
<xsl:for-each select="s:urlset/s:url">
<tr>
<td><xsl:value-of select="s:loc"/></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>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
1 change: 1 addition & 0 deletions templates/sitemap.xml.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="{{ base_url }}/user/plugins/sitemap/sitemap.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for entry in sitemap %}
<url>
Expand Down

0 comments on commit 671a735

Please sign in to comment.