You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2014/12/15 11:44:09 UTC

[3/5] incubator-brooklyn-site git commit: Nav submenus also include the top item

Nav submenus also include the top item

Previously, hovering over the 'documentation' nav item (as an example)
would reveal a pop-down menu. But it was not clear that the
'documentation' item itself had a page, meaning sometimes people would
miss the content. This adds the 'documentation' item itself to the
pop-down menu.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/commit/8f7a85ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/tree/8f7a85ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/diff/8f7a85ad

Branch: refs/heads/master
Commit: 8f7a85ad079e74c95f2e9cc6cf27cee605971867
Parents: 6dc6bde
Author: Richard Downer <ri...@apache.org>
Authored: Wed Nov 26 16:42:34 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Wed Nov 26 16:42:34 2014 +0000

----------------------------------------------------------------------
 _layouts/base.html                  | 4 ++++
 _plugins/site_structure.rb          | 3 +++
 index.md                            | 6 +++---
 quickstart/policies-and-catalogs.md | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/blob/8f7a85ad/_layouts/base.html
----------------------------------------------------------------------
diff --git a/_layouts/base.html b/_layouts/base.html
index b4c4b02..9bc6600 100644
--- a/_layouts/base.html
+++ b/_layouts/base.html
@@ -34,6 +34,10 @@
                     <li class="dropdown{% if page.navgroup == navgroup.id %} active{% endif %}">
                         <a href="{{site.url}}{{navgroup.page.url}}">{{navgroup.title}}</a>
                         <ul class="dropdown-menu" role="menu">
+                            <li>
+                                <a href="{{site.url}}{{navgroup.page.url}}">{{navgroup.title_in_menu}}</a>
+                            </li>
+                            <li class="divider"></li>
                             {% for child in navgroup.page.menu2 %}
                             <li>
                                 <a href="{{site.url}}{{child.reference.url}}">{{child.reference.title}}</a>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/blob/8f7a85ad/_plugins/site_structure.rb
----------------------------------------------------------------------
diff --git a/_plugins/site_structure.rb b/_plugins/site_structure.rb
index 8b13568..903d0cf 100644
--- a/_plugins/site_structure.rb
+++ b/_plugins/site_structure.rb
@@ -9,6 +9,9 @@ module SiteStructure
       navgroups = site.pages.detect { |page| page.path == SiteStructure::ROOT }.data['navgroups']
       navgroups.each do |ng|
         ng['page'] = site.pages.detect { |page| page.path == ng['page'] }
+        if not ng['title_in_menu']
+          ng['title_in_menu'] = ng['title'].capitalize
+        end
       end
       site.data['navgroups'] = navgroups
       site.data['structure'] = gen_structure(site, SiteStructure::ROOT, nil, navgroups)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/blob/8f7a85ad/index.md
----------------------------------------------------------------------
diff --git a/index.md b/index.md
index ffff6df..2193329 100644
--- a/index.md
+++ b/index.md
@@ -11,9 +11,9 @@ children:
 navgroups:
 - { id: learnmore, page: learnmore.md, title: learn more }
 - { id: download, page: download.md, title: download }
-- { id: getstarted, page: quickstart/index.md, title: get started }
-- { id: documentation, page: documentation.md, title: documentation }
-- { id: community, page: community/index.md, title: community }
+- { id: getstarted, page: quickstart/index.md, title: get started, title_in_menu: Get started }
+- { id: documentation, page: documentation.md, title: documentation, title_in_menu: All documentation }
+- { id: community, page: community/index.md, title: community, title_in_menu: Community home }
 ---
 
 <div class="jumbotron">

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn-site/blob/8f7a85ad/quickstart/policies-and-catalogs.md
----------------------------------------------------------------------
diff --git a/quickstart/policies-and-catalogs.md b/quickstart/policies-and-catalogs.md
index 7e6723f..bfeb231 100644
--- a/quickstart/policies-and-catalogs.md
+++ b/quickstart/policies-and-catalogs.md
@@ -1,5 +1,5 @@
 ---
-title: Getting Started - Policies and Catalogs
+title: Policies and Catalogs
 layout: normal
 ---