From 4fe74d52a95d19eb0c193c56268a0abb226b8cfc Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Wed, 19 Feb 2014 12:49:29 -0800 Subject: [PATCH] Updated the CDN links in the setup guide --- Gruntfile.js | 12 ++++++++++++ contrib.json | 4 ++++ docs/guides/setup.md | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 58a079d54..b113d1e35 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -348,6 +348,18 @@ module.exports = function(grunt) { grunt.file.write('dist/cdn/video.js', jsmin + cdnjs); }); + grunt.registerTask('cdn-links', 'Update the version of CDN links in docs', function(){ + var doc = grunt.file.read('docs/guides/setup.md'); + var version = pkg.version; + + // remove the patch version to point to the latest patch + version = version.replace(/(\d\.\d)\.\d/, '$1'); + + // update the version in http://vjs.zencdn.net/4.3/video.js + doc = doc.replace(/(\/\/vjs\.zencdn\.net\/)\d\.\d(\.\d)?/g, '$1'+version); + grunt.file.write('docs/guides/setup.md', doc); + }); + grunt.registerTask('dist', 'Creating distribution', ['dist-copy', 'zip:dist']); }; diff --git a/contrib.json b/contrib.json index 98bcd9626..eb6172558 100644 --- a/contrib.json +++ b/contrib.json @@ -75,6 +75,10 @@ "desc": "Rebuild the docs", "exec": "grunt vjsdocs" }, + { + "desc": "Update the cdn urls in the docs", + "exec": "grunt cdn-links" + }, { "desc": "Tag the release", "exec": "grunt tagrelease" diff --git a/docs/guides/setup.md b/docs/guides/setup.md index 8a8598181..8836716cc 100644 --- a/docs/guides/setup.md +++ b/docs/guides/setup.md @@ -20,8 +20,8 @@ You can download the Video.js source and host it on your own servers, or use the ### CDN Version ### ```html - - + + ``` ### Self Hosted. ###