You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/09/02 03:54:37 UTC

[3/4] docs commit: Adding linting, link verifier and slack and twitter badges

Adding linting, link verifier and slack and twitter badges


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

Branch: refs/heads/cordova-website
Commit: fdf25e7d8ac1239950d08ddf2f01f19ef04ba829
Parents: 8f7862d
Author: Raghav Katyal <ra...@microsoft.com>
Authored: Fri Aug 28 19:39:37 2015 -0700
Committer: Dmitry Blotsky <dm...@gmail.com>
Committed: Tue Sep 1 18:54:00 2015 -0700

----------------------------------------------------------------------
 gulpfile.js               | 20 ++++++++++++++++++++
 package.json              |  4 +++-
 www/_includes/footer.html |  5 +++++
 3 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/fdf25e7d/gulpfile.js
----------------------------------------------------------------------
diff --git a/gulpfile.js b/gulpfile.js
index fdca6ca..e4700e3 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -19,6 +19,8 @@ var browserify = require("browserify");
 var reactify   = require("reactify");
 var uglify     = require("gulp-uglify");
 var envify     = require("envify");
+var htmllint   = require('gulp-htmllint');
+var crawler    = require('simplecrawler');
 
 // constants
 var CONFIG_FILES = ["_config.yml", "_defaults.yml"];
@@ -31,6 +33,7 @@ var WATCH_INTERVAL    = 1000; // in milliseconds
 var ROOT_DIR   = ".";
 var SOURCE_DIR = path.join(ROOT_DIR, "www");
 var DEV_DIR    = path.join(ROOT_DIR, "build-dev");
+var LINT_DIR    = path.join(DEV_DIR, "blog");
 var PROD_DIR   = path.join(ROOT_DIR, "build-prod");
 var BASE_URL   = "/use-the-force-luke";
 
@@ -247,6 +250,23 @@ gulp.task("link-bugs", function (done) {
     exec(bin("linkify-bugs.sh"), [path.join(SOURCE_DIR, "_posts")], done);
 });
 
+gulp.task('lint', function() {
+    return gulp.src(path.join(LINT_DIR, "**", "*.html"))
+        .pipe(htmllint());
+});
+
+gulp.task('checklinks', function(cb) {
+  crawler.crawl('http://localhost:3000/')
+    .on('fetch404', function(queueItem, response) {
+      gutil.log('Resource not found linked from ' +
+                      queueItem.referrer + ' to', queueItem.url);
+      gutil.log('Status code: ' + response.statusCode);
+    })
+    .on('complete', function(queueItem) {
+      cb();
+    });
+});
+
 gulp.task("clean", function () {
     remove(DEV_DIR);
     remove(PROD_DIR);

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/fdf25e7d/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3353434..9c8c8bd 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,9 @@
     "colors": "^1.0.3",
     "diff": "^1.2.0",
     "jshint": "^2.5.8",
-    "mocha": "^1.21.4"
+    "mocha": "^1.21.4",
+    "gulp-htmllint": "^0.0.5",
+    "simplecrawler": "^0.5.2"
   },
   "repository": {
     "type": "git",

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/fdf25e7d/www/_includes/footer.html
----------------------------------------------------------------------
diff --git a/www/_includes/footer.html b/www/_includes/footer.html
index 7bc1b85..c16b225 100644
--- a/www/_includes/footer.html
+++ b/www/_includes/footer.html
@@ -54,6 +54,8 @@
                 <a href="{{ site.baseurl }}/contribute" class="btn btn-lg btn-primary">
                     Learn More
                 </a>
+                <p style="padding-top:20px"> <a href="https://twitter.com/apachecordova" class="twitter-follow-button" data-show-count="false">Follow @apachecordova</a></p>
+                <script async defer src="http://slack.cordova.io/slackin.js"></script>    
             </div>
         </div>
         <p class="copyright_text">
@@ -72,3 +74,6 @@
 <script type="text/javascript" src="{{ site.baseurl }}/static/js/docs.js"></script>
 <script type="text/javascript" src="{{ site.baseurl }}/static/js/main.js"></script>
 <script type="text/javascript" src="{{ site.baseurl }}/static/js/index.js"></script>
+<script>
+    !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
+</script>


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