You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/06/26 12:58:33 UTC

[2/3] sling-site git commit: Sitemap reimplemented

Sitemap reimplemented


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/653dce7e
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/653dce7e
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/653dce7e

Branch: refs/heads/master
Commit: 653dce7e95cc6ff40fe7dfefa5391e93e8d3e7da
Parents: dd196b9
Author: Bertrand Delacretaz <bd...@apache.org>
Authored: Mon Jun 26 14:57:40 2017 +0200
Committer: Bertrand Delacretaz <bd...@apache.org>
Committed: Mon Jun 26 14:57:40 2017 +0200

----------------------------------------------------------------------
 content/sitemap.md    |  4 ++++
 templates/sitemap.tpl | 30 ++++++++++++++++++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sling-site/blob/653dce7e/content/sitemap.md
----------------------------------------------------------------------
diff --git a/content/sitemap.md b/content/sitemap.md
new file mode 100644
index 0000000..d94f2ff
--- /dev/null
+++ b/content/sitemap.md
@@ -0,0 +1,4 @@
+title=Sitemap		
+type=sitemap
+status=published
+~~~~~~

http://git-wip-us.apache.org/repos/asf/sling-site/blob/653dce7e/templates/sitemap.tpl
----------------------------------------------------------------------
diff --git a/templates/sitemap.tpl b/templates/sitemap.tpl
index 6b07c59..40d81c3 100644
--- a/templates/sitemap.tpl
+++ b/templates/sitemap.tpl
@@ -1,9 +1,23 @@
-xmlDeclaration()
-urlset( xmlns:'http://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xsi':'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation':'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'){
-    published_content.each {content ->
-        url {
-    	    loc("${config.site_host}${config.site_contextPath}${content.uri}")
-    	    lastmod("${content.date.format('yyyy-MM-dd')}")
+layout 'layout/main.tpl', true,
+        projects: projects,
+        bodyContents: contents {
+
+            div(class:"sitemap"){
+                section(class:"wrap"){
+                    header{
+                        h1("${content.title}")
+                    }
+					
+					ul {
+						published_content.each {content ->
+							li {
+								a (href:"${config.site_contextPath}${content.uri}") {
+									yield content.title
+								}
+							}
+							newLine()
+						}
+					}
+                }
+            }
         }
-    }
-}
\ No newline at end of file