CB-10056 Adding more metadata for sitemap.xml.

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

Branch: refs/heads/master
Commit: 4284140540c379c55ae672d2ff787f664b70a43d
Parents: 4e345ab
Author: Dmitry Blotsky <dmitry.blot...@gmail.com>
Authored: Fri Nov 20 16:51:35 2015 -0800
Committer: Dmitry Blotsky <dmitry.blot...@gmail.com>
Committed: Fri Nov 20 17:13:58 2015 -0800

----------------------------------------------------------------------
 tools/bin/gen_defaults.js | 27 ++++++++++++++++++++++++---
 www/blog/index.html       |  2 ++
 www/http/404.html         |  1 +
 www/index.html            |  2 ++
 www/plugins/index.html    |  2 ++
 5 files changed, 31 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/42841405/tools/bin/gen_defaults.js
----------------------------------------------------------------------
diff --git a/tools/bin/gen_defaults.js b/tools/bin/gen_defaults.js
index c8b196b..a4082c6 100644
--- a/tools/bin/gen_defaults.js
+++ b/tools/bin/gen_defaults.js
@@ -23,6 +23,17 @@ var yaml = require("js-yaml");
 
 var util = require("./util");
 
+// constants
+var DEV_VERSION_NAME = "dev";
+
+// page change frequency for sitemap.xml
+// reference:
+//      http://www.sitemaps.org/protocol.html#xmlTagDefinitions
+var DEV_CHANGE_FREQUENCY     = "daily";
+var DEV_PAGE_PRIORITY        = 0.8;
+var DEFAULT_CHANGE_FREQUENCY = "monthly";
+var DEFAULT_PAGE_PRIORITY    = DEV_PAGE_PRIORITY / 2;
+
 function main () {
 
     var rootDir = process.argv[2];
@@ -54,8 +65,7 @@ function main () {
             var manual    = util.manualTocfileName(langName, versionName);
             var generated = util.generatedTocfileName(langName, versionName);
 
-            // define version scope
-            config.defaults.push({
+            var versionDefaults = {
                 scope: {
                     path: "docs/" + langName + "/" + versionName
                 },
@@ -64,7 +74,18 @@ function main () {
                     manual_toc:    manual.replace(".yml", ""),
                     generated_toc: generated.replace(".yml", "")
                 }
-            });
+            };
+
+            if (versionName === DEV_VERSION_NAME) {
+                versionDefaults.values.change_frequency = DEV_CHANGE_FREQUENCY;
+                versionDefaults.values.priority         = DEV_PAGE_PRIORITY;
+            } else {
+                versionDefaults.values.change_frequency = 
DEFAULT_CHANGE_FREQUENCY;
+                versionDefaults.values.priority         = DEFAULT_PAGE_PRIORITY
+            }
+
+            // define version scope
+            config.defaults.push(versionDefaults);
         });
     });
 

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/42841405/www/blog/index.html
----------------------------------------------------------------------
diff --git a/www/blog/index.html b/www/blog/index.html
index 263f188..2a1b63d 100644
--- a/www/blog/index.html
+++ b/www/blog/index.html
@@ -1,6 +1,8 @@
 ---
 layout: blog
 title: Blog
+change_frequency: weekly
+priority: 0.7
 ---
 
 <div class="row">

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/42841405/www/http/404.html
----------------------------------------------------------------------
diff --git a/www/http/404.html b/www/http/404.html
index f87504c..f7c7700 100644
--- a/www/http/404.html
+++ b/www/http/404.html
@@ -2,6 +2,7 @@
 layout: cordova
 title: Page Not Found
 permalink: 404.html
+priority: 0.1
 ---
 
 <div class="not-found-container">

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/42841405/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index 1a8cc50..32eccb5 100644
--- a/www/index.html
+++ b/www/index.html
@@ -1,6 +1,8 @@
 ---
 layout: cordova
 permalink: /
+priority: 1.0
+change_frequency: monthly
 ---
 
 <!-- REMOVE THIS LINK BEFORE PUBLISHING.  This is just for IntelliSense while 
coding -->

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/42841405/www/plugins/index.html
----------------------------------------------------------------------
diff --git a/www/plugins/index.html b/www/plugins/index.html
index 884de4a..9ae98c2 100644
--- a/www/plugins/index.html
+++ b/www/plugins/index.html
@@ -2,6 +2,8 @@
 layout: plugins
 title: Plugin Search
 description: Search here for Apache Cordova plugins published on NPM.
+priority: 0.9
+change_frequency: daily
 ---
 
 <!-- Main jumbotron for a primary marketing message or call to action -->


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

Reply via email to