cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject [18/18] docs commit: Adding split configs for extensibility (_dev.yml and _prod.yml). Fixing top navbar selected tabs and links. Adding language names.
Date Thu, 06 Aug 2015 06:41:31 GMT
Adding split configs for extensibility (_dev.yml and _prod.yml). Fixing top navbar selected
tabs and links. Adding language names.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/219d7b16
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/219d7b16
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/219d7b16

Branch: refs/heads/cordova-website
Commit: 219d7b16a1d17eb1b9dbb249174e1407e1b07490
Parents: 900de4c
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Wed Aug 5 23:41:06 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Wed Aug 5 23:41:06 2015 -0700

----------------------------------------------------------------------
 .gitignore                 |  1 +
 _config.yml                | 37 ---------------------------
 _dev.yml                   | 38 ++++++++++++++++++++++++++++
 _prod.yml                  |  4 +++
 gulpfile.js                | 34 +++++++++++++++++--------
 tools/bin/gen_languages.py | 24 +++++++++++++++---
 www/_includes/header.html  | 56 +++++++++++++++++++++++------------------
 www/_layouts/blog.html     |  6 +++++
 www/_layouts/docs.html     |  1 +
 www/_layouts/post.html     |  2 +-
 www/blog/index.html        | 20 +++++++--------
 11 files changed, 137 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 1d3bd40..01c31fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 public
+deploy
 *.pyc
 _defaults.yml
 www/_data/languages.yml

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/_config.yml
----------------------------------------------------------------------
diff --git a/_config.yml b/_config.yml
index 9592fd6..6889e29 100644
--- a/_config.yml
+++ b/_config.yml
@@ -35,40 +35,3 @@ rdiscount:
 # exclude directories from the build
 exclude:
     - static/css-src
-    - docs/de
-    - docs/es
-    - docs/fr
-    - docs/it
-    - docs/ja
-    - docs/ko
-    - docs/pl
-    - docs/ru
-    - docs/sl
-    - docs/zh
-    - docs/en/1.5.0
-    - docs/en/1.6.0
-    - docs/en/1.6.1
-    - docs/en/1.7.0
-    - docs/en/1.8.0
-    - docs/en/1.8.1
-    - docs/en/1.9.0
-    - docs/en/2.0.0
-    - docs/en/2.1.0
-    - docs/en/2.2.0
-    - docs/en/2.3.0
-    - docs/en/2.4.0
-    - docs/en/2.5.0
-    - docs/en/2.6.0
-    - docs/en/2.7.0
-    - docs/en/2.8.0
-    - docs/en/2.9.0
-    - docs/en/3.0.0
-    - docs/en/3.1.0
-    - docs/en/3.2.0
-    - docs/en/3.3.0
-    - docs/en/3.4.0
-    - docs/en/3.5.0
-    - docs/en/3.6.0
-    - docs/en/4.0.0
-    - docs/en/5.1.1
-    # not excluding edge or 5.0.0 for english (testing purposes)

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/_dev.yml
----------------------------------------------------------------------
diff --git a/_dev.yml b/_dev.yml
new file mode 100644
index 0000000..d1f6562
--- /dev/null
+++ b/_dev.yml
@@ -0,0 +1,38 @@
+exclude:
+    - static/css-src
+    - docs/de
+    - docs/es
+    - docs/fr
+    - docs/it
+    - docs/ja
+    - docs/ko
+    - docs/pl
+    - docs/sl
+    - docs/zh
+    - docs/en/1.5.0
+    - docs/en/1.6.0
+    - docs/en/1.6.1
+    - docs/en/1.7.0
+    - docs/en/1.8.0
+    - docs/en/1.8.1
+    - docs/en/1.9.0
+    - docs/en/2.0.0
+    - docs/en/2.1.0
+    - docs/en/2.2.0
+    - docs/en/2.3.0
+    - docs/en/2.4.0
+    - docs/en/2.5.0
+    - docs/en/2.6.0
+    - docs/en/2.7.0
+    - docs/en/2.8.0
+    - docs/en/2.9.0
+    - docs/en/3.0.0
+    - docs/en/3.1.0
+    - docs/en/3.2.0
+    - docs/en/3.3.0
+    - docs/en/3.4.0
+    - docs/en/3.5.0
+    - docs/en/3.6.0
+    - docs/en/4.0.0
+    - docs/en/5.1.1
+    # not excluding edge or 5.0.0 for english (testing purposes)

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/_prod.yml
----------------------------------------------------------------------
diff --git a/_prod.yml b/_prod.yml
new file mode 100644
index 0000000..1cbc5ac
--- /dev/null
+++ b/_prod.yml
@@ -0,0 +1,4 @@
+baseurl: "/use-the-force-luke"
+destination: deploy
+exclude:
+    - static/css-src

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/gulpfile.js
----------------------------------------------------------------------
diff --git a/gulpfile.js b/gulpfile.js
index d92d21e..357fdec 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -15,10 +15,12 @@ var header      = require("gulp-header");
 
 // constants
 var CONFIG_FILES = ["_config.yml", "_defaults.yml"];
-var JEKYLL_FLAGS = ["--trace", "--config", CONFIG_FILES.join(",")];
+var DEV_FLAGS    = ["--config", CONFIG_FILES.concat(["_dev.yml"]).join(","), "--trace"];
+var PROD_FLAGS   = ["--config", CONFIG_FILES.concat(["_prod.yml"]).join(",")];
 
 var SOURCE_DIR = "www";
 var BUILD_DIR  = "public";
+var DEPLOY_DIR = "deploy";
 
 var WATCH_INTERVAL = 1000; // in milliseconds
 
@@ -49,7 +51,7 @@ function bin(name) {
 }
 
 // tasks
-gulp.task("default", ["build"], function () {
+gulp.task("default", ["build-dev"], function () {
     gulp.run("serve");
     gulp.run("watch");
 });
@@ -60,7 +62,7 @@ gulp.task("watch", function () {
             path.join(CSS_SRC_DIR, "**", "*"),
         ],
         {interval: WATCH_INTERVAL},
-        ["styles", "regenerate"]
+        ["styles", "regen-dev"]
     );
     gulp.watch(
         [
@@ -68,7 +70,7 @@ gulp.task("watch", function () {
             path.join(DOCS_DIR, "**", "*.html"),
         ],
         {interval: WATCH_INTERVAL},
-        ["configs", "regenerate"]
+        ["configs", "regen-dev"]
     );
     gulp.watch(
         [
@@ -81,22 +83,33 @@ gulp.task("watch", function () {
             path.join(CSS_OUT_DIR, "**", "*.css"),
         ],
         {interval: WATCH_INTERVAL},
-        ["regenerate"]
+        ["regen-dev"]
     );
 });
 
-gulp.task("generate", function (done) {
-    exec("C:\\Ruby21\\bin\\jekyll.bat", ["build"].concat(JEKYLL_FLAGS), done);
+gulp.task("gen-dev", function (done) {
+    exec("C:\\Ruby21\\bin\\jekyll.bat", ["build"].concat(DEV_FLAGS), done);
 });
 
-gulp.task("regenerate", ["generate"], function () {
+gulp.task("regen-dev", ["gen-dev"], function () {
     browsersync.reload();
 });
 
-gulp.task("build", ["styles", "configs"], function () {
-    gulp.run("generate");
+gulp.task("build-dev", ["configs", "styles"], function () {
+    gulp.run("gen-dev");
 });
 
+gulp.task("gen-prod", function (done) {
+    exec("C:\\Ruby21\\bin\\jekyll.bat", ["build"].concat(PROD_FLAGS), done);
+});
+
+gulp.task("build-prod", ["configs", "styles"], function (done) {
+    gulp.run("gen-prod");
+});
+
+gulp.task("build", ["build-dev"]);
+gulp.task("deploy", ["build-prod"]);
+
 gulp.task("serve", function (done) {
     browsersync({
         notify: true,
@@ -135,6 +148,7 @@ gulp.task("link-bugs", function (done) {
 
 gulp.task("clean", function () {
     fse.remove(BUILD_DIR);
+    fse.remove(DEPLOY_DIR);
     fse.remove(path.join(DATA_DIR, "toc", "*-generated.yml"));
     fse.remove(CSS_OUT_DIR);
     fse.remove(LANGUAGES_FILE);

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/tools/bin/gen_languages.py
----------------------------------------------------------------------
diff --git a/tools/bin/gen_languages.py b/tools/bin/gen_languages.py
index cc40be8..9be6032 100644
--- a/tools/bin/gen_languages.py
+++ b/tools/bin/gen_languages.py
@@ -1,22 +1,38 @@
+# -*- coding: utf-8 -*-
+
 import os
 import sys
 import yaml
 
 from util import *
 
+LANGUAGE_MAP = {
+    'de': u'Deutsch',
+    'en': u'English',
+    'es': u'Español',
+    'fr': u'Français',
+    'it': u'Italiano',
+    'ja': u'日本語',
+    'ko': u'한국어',
+    'pl': u'Polski',
+    'ru': u'Русский',
+    'sl': u'Slovene',
+    'zh': u'汉语',
+}
+
 def main():
 
     root_dir = sys.argv[1]
     config   = {}
 
     # extract configuration
-    for lang_name in listdirs(root_dir):
+    for lang_id in listdirs(root_dir):
 
-        lang_path     = os.path.join(root_dir, lang_name)
+        lang_path     = os.path.join(root_dir, lang_id)
         version_names = list(listdirs(lang_path))
 
-        config[lang_name] = {
-            'name':     lang_name,
+        config[lang_id] = {
+            'name':     LANGUAGE_MAP[lang_id],
             'versions': version_names
         }
 

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/www/_includes/header.html
----------------------------------------------------------------------
diff --git a/www/_includes/header.html b/www/_includes/header.html
index a90c6be..bad969f 100644
--- a/www/_includes/header.html
+++ b/www/_includes/header.html
@@ -1,32 +1,40 @@
-<a class="scroll-point pt-top" name="top">
-</a>
-    <nav class="navbar navbar-inverse navbar-fixed-top">
-      <div class="container-fluid">
+<a class="scroll-point pt-top" name="top"></a>
+<nav class="navbar navbar-inverse navbar-fixed-top">
+    <div class="container-fluid">
         <div class="navbar-header">
-          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar" aria-expanded="false" aria-controls="navbar">
-            <span class="sr-only">Toggle navigation</span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-          </button>
-          <a class="navbar-brand" href="{{ site.baseurl }}/"><img id="logo_top"
src="{{ site.baseurl }}/static/img/logo_full_2.svg"/></a>
+            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar" aria-expanded="false" aria-controls="navbar">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="{{ site.baseurl }}/"><img id="logo_top"
src="{{ site.baseurl }}/static/img/logo_full_2.svg"/></a>
         </div>
         <div id="navbar" class="navbar-collapse collapse">
-        <img class="pull-right hidden-xs" style="width:25px" src="{{ site.baseurl }}/static/img/search_icon.svg"/>
+            <img class="pull-right hidden-xs" style="width:25px" src="{{ site.baseurl
}}/static/img/search_icon.svg"/>
             <div class="nav_bar_center">
                 <ul class="nav navbar-nav">
-                    <li class="active"><a href="{{ site.baseurl }}/docs/en/edge">Documentation</a></li>
-                    <li><a href="http://plugins.cordova.io/">Plugins</a></li>
-                    <li><a href="{{ site.baseurl }}/blog">Blog<span class="badge">5</span></a></li>
-                    <li><a href="#contribute">Contribute</a></li>
-                    <li><a href="#contact">Contact</a></li>
-                    <li class="visible-xs"><img class="" style="width:25px;margin-left:13px"
src="{{ site.baseurl }}/static/img/search_icon.svg"/></li>
-              </ul>
+                    <li {% if page.docs_tab %}class="active"{% endif %}>
+                        <a href="{{ site.baseurl }}/docs/en/edge/guide/cli/">Documentation</a>
+                    </li>
+                    <li>
+                        <a href="http://plugins.cordova.io/">Plugins</a>
+                    </li>
+                    <li {% if page.blog_tab %}class="active"{% endif %}>
+                        <a href="{{ site.baseurl }}/blog">Blog<span class="badge">5</span></a>
+                    </li>
+                    <li>
+                        <a href="{{ site.baseurl }}/#contribute">Contribute</a>
+                    </li>
+                    <li>
+                        <a href="{{ site.baseurl }}/#contact">Contact</a>
+                    </li>
+                    <li class="visible-xs">
+                        <img class="" style="width:25px;margin-left:13px" src="{{ site.baseurl
}}/static/img/search_icon.svg"/>
+                    </li>
+                </ul>
             </div>
         </div><!--/.navbar-collapse -->
-      </div>
-    </nav>
+    </div>
+</nav>
 <div id="_fixed_navbar_spacer" style="padding-top:50px"></div>
-
-
-

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/www/_layouts/blog.html
----------------------------------------------------------------------
diff --git a/www/_layouts/blog.html b/www/_layouts/blog.html
new file mode 100644
index 0000000..4a2cfd9
--- /dev/null
+++ b/www/_layouts/blog.html
@@ -0,0 +1,6 @@
+---
+layout: cordova
+blog_tab: true
+---
+
+{{ content }}

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/www/_layouts/docs.html
----------------------------------------------------------------------
diff --git a/www/_layouts/docs.html b/www/_layouts/docs.html
index 53df54f..1adc7ec 100644
--- a/www/_layouts/docs.html
+++ b/www/_layouts/docs.html
@@ -1,5 +1,6 @@
 ---
 layout: cordova
+docs_tab: true
 ---
 
 <div class="container">

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/www/_layouts/post.html
----------------------------------------------------------------------
diff --git a/www/_layouts/post.html b/www/_layouts/post.html
index 452bda8..e516056 100644
--- a/www/_layouts/post.html
+++ b/www/_layouts/post.html
@@ -1,5 +1,5 @@
 ---
-layout: cordova
+layout: blog
 ---
 <div class="site container">
     <h2>{{ page.title }}</h2>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/219d7b16/www/blog/index.html
----------------------------------------------------------------------
diff --git a/www/blog/index.html b/www/blog/index.html
index 3d39759..ccab47e 100644
--- a/www/blog/index.html
+++ b/www/blog/index.html
@@ -1,24 +1,24 @@
 ---
-layout: cordova
+layout: blog
 title: Apache Cordova Blog
 ---
 
 <div class="blog">
   <div id="content" class="container fill">
-    <div class="col-sm-8 blog-list">  
+    <div class="col-sm-8 blog-list">
       <div class="blogHeader">
         <h1>Blog</h1>
         <div>
           <img src="{{ site.baseurl }}/static/img/subscribe.png">
           <a href="{{ site.baseurl }}{{ site.rss_path }}">Subscribe</a>
         </div>
-      </div>        
+      </div>
       <ul class="posts">
           {% for post in site.posts %}
           <li>
             <header>
               <div class="adorner"></div>
-              <div> 
+              <div>
                 <div class="title"><a href="{{ site.baseurl }}{{ post.url }}">{{
post.title }}</a></div>
                 <div><span class="date">{{ post.date | date_to_string }}</span><span>
- by </span><span class="author"><a href="{{ post.author.url }}">{{ post.author.name
}}</a></span></div>
               </div>
@@ -31,10 +31,10 @@ title: Apache Cordova Blog
           {% endfor %}
       </ul>
       <a href="http://feed1.w3.org/check.cgi?url={{ site.baseurl }}{{ site.rss_path }}"><img
src="{{ site.baseurl }}/static/img/valid-rss-rogers.png" alt="[Valid RSS]" title="Validate
my RSS feed" /></a>
-    </div>   
-    
-    <div class="col-sm-4 social-container">    
-        {% include twitterFeed.html %}        
-    </div>      
+    </div>
+
+    <div class="col-sm-4 social-container">
+        {% include twitterFeed.html %}
+    </div>
   </div>
-</div>
\ No newline at end of file
+</div>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message