You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/08/06 13:09:43 UTC
[sling-org-apache-sling-starter-content] branch master updated:
SLING-8616 - Add basic extensibility model
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter-content.git
The following commit(s) were added to refs/heads/master by this push:
new 449fd3b SLING-8616 - Add basic extensibility model
449fd3b is described below
commit 449fd3bda126dcc922005e2361e70deeb6116e66
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Aug 6 16:09:25 2019 +0300
SLING-8616 - Add basic extensibility model
All resources under content/starter/sidebar-extensions are evaluated and included
in the sidebar.
---
README.md | 5 +++++
src/main/resources/content/ROOT.json | 9 ++++++++-
.../content/apps/sling/starter/home/home.html | 1 +
.../sidebar-extensions/sidebar-extensions.html | 21 +++++++++++++++++++++
src/main/resources/content/content/starter.json | 7 -------
5 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 1c0fe3c..9504f33 100644
--- a/README.md
+++ b/README.md
@@ -8,3 +8,8 @@ The Starter Content bundle provides some initial and sample content as well as l
This module is part of the [Apache Sling](https://sling.apache.org) project.
+
+
+## Extensibility
+
+Additional content can be provided by placing resources under `/content/starter/sidebar-extensions`. These will be rendered in the right sidebar.
\ No newline at end of file
diff --git a/src/main/resources/content/ROOT.json b/src/main/resources/content/ROOT.json
index 31c3367..0349b63 100644
--- a/src/main/resources/content/ROOT.json
+++ b/src/main/resources/content/ROOT.json
@@ -3,6 +3,13 @@
"sling:target": "/starter.html",
"content" : {
"sling:resourceType": "sling:redirect",
- "sling:target": "/starter.html"
+ "sling:target": "/starter.html",
+ "starter" : {
+ "sling:resourceType": "sling/starter/home",
+ "jcr:resourceType": "sling:Folder",
+ "sidebar-extensions" : {
+ "sling:resourceType": "sling/starter/sidebar-extensions",
+ }
+ }
}
}
diff --git a/src/main/resources/content/apps/sling/starter/home/home.html b/src/main/resources/content/apps/sling/starter/home/home.html
index 482b32b..7412647 100755
--- a/src/main/resources/content/apps/sling/starter/home/home.html
+++ b/src/main/resources/content/apps/sling/starter/home/home.html
@@ -77,6 +77,7 @@
<li><a href="https://github.com/apache/sling-aggregator" target="_blank" rel="noopener" title="View the Sling Aggregator on Github">All Sling repos</a></li>
<li><a href="https://github.com/apache/sling-samples" target="_blank" rel="noopener" title="View Apache Sling sample applications on Github">Sample Applications</a></li>
</ul>
+ <sly data-sly-resource="sidebar-extensions"/>
</section>
</div>
</div>
diff --git a/src/main/resources/content/apps/sling/starter/sidebar-extensions/sidebar-extensions.html b/src/main/resources/content/apps/sling/starter/sidebar-extensions/sidebar-extensions.html
new file mode 100644
index 0000000..3784fa1
--- /dev/null
+++ b/src/main/resources/content/apps/sling/starter/sidebar-extensions/sidebar-extensions.html
@@ -0,0 +1,21 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<sly data-sly-list.extension="${resource.children}">
+ <sly data-sly-resource="${extension.path}"/>
+</sly>
\ No newline at end of file
diff --git a/src/main/resources/content/content/starter.json b/src/main/resources/content/content/starter.json
deleted file mode 100644
index 644c39b..0000000
--- a/src/main/resources/content/content/starter.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "sling:resourceType": "sling/starter/home",
- "jcr:resourceType": "sling:Folder",
- "hostname": {
- "sling:resourceType": "sling/starter/hostname"
- }
-}
\ No newline at end of file