Repository: apex-site Updated Branches: refs/heads/master 7872cbc7a -> c39829b7b
APEXCORE-514 Improve Apex Website navigations Project: http://git-wip-us.apache.org/repos/asf/apex-site/repo Commit: http://git-wip-us.apache.org/repos/asf/apex-site/commit/dc95ab64 Tree: http://git-wip-us.apache.org/repos/asf/apex-site/tree/dc95ab64 Diff: http://git-wip-us.apache.org/repos/asf/apex-site/diff/dc95ab64 Branch: refs/heads/master Commit: dc95ab64bdc06e45b48671485fc7c3dce9a1b14b Parents: 2639c0c Author: Michelle Xiao <[email protected]> Authored: Wed Oct 5 10:41:24 2016 -0700 Committer: Michelle Xiao <[email protected]> Committed: Sun Oct 9 21:02:11 2016 -0700 ---------------------------------------------------------------------- gulpfile.js | 5 +++-- navigation.json | 7 +++++- src/js/docs.js | 42 +++++++++++++++++++++++++++++++++++ src/less/docs.less | 44 +++++++++++++++++++++++++++++++++++++ src/less/header.less | 14 ++++++++++++ src/less/main.less | 1 + src/md/docs.md | 2 +- src/pages/docs.html | 16 +++++++++++++- src/pages/index.html | 1 + src/partials/footer.handlebars | 2 ++ src/partials/header.handlebars | 31 ++++++++++++++++++-------- 11 files changed, 151 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/gulpfile.js ---------------------------------------------------------------------- diff --git a/gulpfile.js b/gulpfile.js index 233e4f0..8bf19e2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -99,7 +99,8 @@ gulp.task('less', function () { // Copies necessary dependencies to dist gulp.task('copy:js', function() { return gulp.src([ - './bower_components/bootstrap/dist/js/bootstrap.min.js' + './bower_components/bootstrap/dist/js/bootstrap.min.js', + './src/js/*.js' ]) .pipe(gulp.dest(path.join(BUILD_LOCATION, 'js'))); }); @@ -446,4 +447,4 @@ gulp.task('fetch-releases', function(taskCb) { gulp.task('watch', function() { gulp.watch('./src/less/*.less', ['less']); gulp.watch(['./src/pages/*.html', './src/partials/*.handlebars', './src/md/*.md'], ['html']); -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/navigation.json ---------------------------------------------------------------------- diff --git a/navigation.json b/navigation.json index 8255001..ea5e8df 100644 --- a/navigation.json +++ b/navigation.json @@ -1,7 +1,12 @@ [ { "id": "index", "label": "Home", "href": "/" }, + { "id": "Powered by Apex", "label": "Powered By Apex", "href": "/powered-by-apex.html" }, + { "id": "roadmap", "label": "Roadmap", "href": "/roadmap.html" }, { "id": "announcements", "label": "Announcements", "href": "/announcements.html" }, - { "id": "community", "label": "Community", "href": "/community.html" }, + { "id": "community", "label": "Community", "href": "/community.html", "items": [ + { "label": "Contributing", "href": "/community.html#contributing" }, + { "label": "Newest \"apache-apex\" Questions - Stack Overflow", "href": "http://stackoverflow.com/questions/tagged/apache-apex" } + ]}, { "id": "docs", "label": "Docs", "href": "/docs.html" }, { "id": "source", "label": "Source", "items": [ { "label": "Apex Core (ASF)", "href": "https://git-wip-us.apache.org/repos/asf?p=apex-core.git" }, http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/js/docs.js ---------------------------------------------------------------------- diff --git a/src/js/docs.js b/src/js/docs.js new file mode 100644 index 0000000..7168c39 --- /dev/null +++ b/src/js/docs.js @@ -0,0 +1,42 @@ +$(function(){ + if($(".fixed-links").length == 0) { + return false; + } + + var fl = $(".fixed-links"), + flh = fl.height(), + navh = $("nav").height(); + + $(window).scroll(function() { + if( $(this).scrollTop() > navh ) { + fl.addClass("stick"); + } else { + fl.removeClass("stick"); + } + }); + + var target, topV; + + $(".docs-nav ul li a[href^='#']").click(function() { + target = $(this.hash); + + $(this).parents("ul").find("li.active").removeClass("active"); + $(this).parent().addClass("active"); + + if (target.length == 0){ + console.log("anchor is not right."); + return false; + } + + if(fl.hasClass("stick")) { + topV = flh + 10; + }else{ + topV = 2* flh + 20; + } + + $('html, body').animate({ + scrollTop: target.offset().top - topV}, 500); + + return false; + }); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/less/docs.less ---------------------------------------------------------------------- diff --git a/src/less/docs.less b/src/less/docs.less new file mode 100644 index 0000000..b1c238a --- /dev/null +++ b/src/less/docs.less @@ -0,0 +1,44 @@ +@media (max-width: 992px) { + div.docs-nav { + display: none; + } +} + +.fixed-links { + text-align: center; +} + +div.docs-nav ul li { + display: inline-block; + border-bottom: 4px solid #dad9d6; + width: 160px; + margin: 0 -4px; + padding: 0; +} + +div.docs-nav ul li.write-apex { + width: 250px; +} + +div.docs-nav ul li.blogs { + width: 70px; +} + +div.docs-nav ul li.active { + border-bottom: 4px solid #456b7e; +} + +div.docs-nav ul li a { + text-decoration: none; + display: block; + padding: 20px 0; +} + +.stick { + background-color: whitesmoke; + position: fixed; + width: 100%; + left: 0; + top: 0; + z-index: 100; +} http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/less/header.less ---------------------------------------------------------------------- diff --git a/src/less/header.less b/src/less/header.less index 1a7e265..e6fbb85 100644 --- a/src/less/header.less +++ b/src/less/header.less @@ -51,4 +51,18 @@ } .navbar-toggle { background-color: rgba(255, 255, 255, 0.5); +} + +.nav-mouseover:hover .dropdown-menu { + display: block; +} + +.nav-mouseover .dropdown-menu:hover + a { + background-color: #e7e7e7; + color: #555; +} + +.dropdown-menu { + left: 0 !important; + right: auto !important; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/less/main.less ---------------------------------------------------------------------- diff --git a/src/less/main.less b/src/less/main.less index 3a72cb1..641da05 100644 --- a/src/less/main.less +++ b/src/less/main.less @@ -5,4 +5,5 @@ @import "./index.less"; @import "./body.less"; @import "./downloads.less"; +@import "./docs.less"; @import (inline) "../../node_modules/highlight.js/styles/color-brewer.css"; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/md/docs.md ---------------------------------------------------------------------- diff --git a/src/md/docs.md b/src/md/docs.md index 25822c4..02d8ee4 100644 --- a/src/md/docs.md +++ b/src/md/docs.md @@ -1,4 +1,4 @@ -# Documentation +### Documentation - **[Apache Apex Core Documentation](/docs/apex/)** including overviews of the product, security, application development, operators and the commandline tool. - **[Apache Apex Malhar Documentation](/docs/malhar/)** for the operator library including a diagrammatic taxonomy and some in-depth tutorials for selected operators (such as Kafka Input). http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/pages/docs.html ---------------------------------------------------------------------- diff --git a/src/pages/docs.html b/src/pages/docs.html index 33a54c1..8157743 100644 --- a/src/pages/docs.html +++ b/src/pages/docs.html @@ -1,4 +1,18 @@ -{{> header}} +{{> header}} + +<div class="container"> + <div class="docs-nav"><strong> + <div class="fixed-links"> + <ul> + <li class="active"><a href="#documentation">Documentation</a></li> + <li class="write-apex"><a href="#writing-apache-apex-applications">Writing Apache Apex Applications</a></li> + <li><a href="#presentations">Presentations</a></li> + <li class="blogs"><a href="#blogs">Blogs</a></li> + <li><a href="#trouble-shooting">Trouble Shooting</a></li> + </ul> + </div> + </strong></div> +</div> <div class="container"> http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/pages/index.html ---------------------------------------------------------------------- diff --git a/src/pages/index.html b/src/pages/index.html index 4f950de..27b3b30 100644 --- a/src/pages/index.html +++ b/src/pages/index.html @@ -14,6 +14,7 @@ <a class="btn btn-info btn-lg" href="/community.html" role="button">Community</a> <a class="btn btn-info btn-lg" href="/docs.html" role="button">Documentation</a> <a class="btn btn-info btn-lg" href="https://github.com/apache/apex-core" role="button">Github</a> + <a class="btn btn-success btn-lg" href="/downloads.html" role="button" target="_blank">Download</a> </p> </div> </div> http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/partials/footer.handlebars ---------------------------------------------------------------------- diff --git a/src/partials/footer.handlebars b/src/partials/footer.handlebars index 35d4ca5..21b521b 100644 --- a/src/partials/footer.handlebars +++ b/src/partials/footer.handlebars @@ -13,6 +13,8 @@ <!-- Placed at the end of the document so the pages load faster --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="/js/bootstrap.min.js"></script> + <script src="js/docs.js"></script> + <script> $('#copyright-year').text((new Date()).getFullYear()); </script> http://git-wip-us.apache.org/repos/asf/apex-site/blob/dc95ab64/src/partials/header.handlebars ---------------------------------------------------------------------- diff --git a/src/partials/header.handlebars b/src/partials/header.handlebars index 4671675..58e4d5e 100644 --- a/src/partials/header.handlebars +++ b/src/partials/header.handlebars @@ -12,7 +12,7 @@ <!-- Main Stylesheet --> <link href="css/main.css" rel="stylesheet"> - + </head> <body> @@ -36,14 +36,27 @@ <ul class="nav navbar-right navbar-nav"> {{#each nav}} {{#if items}} - <li class="nav-item"> - <a href="#" data-toggle="dropdown" class="dropdown-toggle nav-link">{{label}}<b class="caret"></b></a> - <ul class="dropdown-menu"> - {{#each items}} - <li><a href="{{href}}">{{label}}</a></li> - {{/each}} - </ul> - </li> + + {{#if href}} + <li class="nav-item nav-mouseover"> + <ul class="dropdown-menu"> + {{#each items}} + <li><a href="{{href}}">{{label}}</a></li> + {{/each}} + </ul> + <a href="{{href}}" class="nav-link">{{label}}</a> + </li> + {{else}} + <li class="nav-item"> + <a href="#" data-toggle="dropdown" class="dropdown-toggle nav-link">{{label}}<b class="caret"></b></a> + <ul class="dropdown-menu"> + {{#each items}} + <li><a href="{{href}}">{{label}}</a></li> + {{/each}} + </ul> + </li> + {{/if}} + {{else}} <li class="nav-item"> <a class="nav-link {{classes}}" href="{{href}}">{{label}}</a>
