diff options
| author | Peter Bacon Darwin | 2014-02-17 14:01:30 +0000 |
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-17 14:01:30 +0000 |
| commit | 4c02d0bea5ff7ce295d2a2f7ed005eac2c82706c (patch) | |
| tree | 9252074253879ba94e782ec87a393789d79fa847 /docs/docs.config.js | |
| parent | 47ec6f5d7f098f7bf73baca0599e6344871168e9 (diff) | |
| download | angular.js-4c02d0bea5ff7ce295d2a2f7ed005eac2c82706c.tar.bz2 | |
chore(docs-assets): add versions to paths for imported assets
This should prevent stale caches in browsers if we upgrade any of these
assets.
Diffstat (limited to 'docs/docs.config.js')
| -rw-r--r-- | docs/docs.config.js | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/docs/docs.config.js b/docs/docs.config.js index cfd94a60..b93cae97 100644 --- a/docs/docs.config.js +++ b/docs/docs.config.js @@ -9,6 +9,12 @@ module.exports = function(config) { var version = gruntUtils.getVersion(); var cdnUrl = "//ajax.googleapis.com/ajax/libs/angularjs/" + version.cdn; + var getVersion = function(component, sourceFolder, packageFile) { + sourceFolder = sourceFolder || '../bower_components'; + packageFile = packageFile || 'bower.json'; + return require(path.join(sourceFolder,component,packageFile)).version; + }; + config = basePackage(config); @@ -38,20 +44,20 @@ module.exports = function(config) { '../angular-sanitize.js', '../angular-touch.js', '../angular-animate.js', - 'components/marked/lib/marked.js', + 'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js', 'js/angular-bootstrap/bootstrap.js', 'js/angular-bootstrap/bootstrap-prettify.js', 'js/angular-bootstrap/dropdown-toggle.js', - 'components/lunr.js/lunr.js', - 'components/google-code-prettify/src/prettify.js', - 'components/google-code-prettify/src/lang-css.js', + 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', 'js/versions-data.js', 'js/pages-data.js', 'js/docs.js' ], stylesheets: [ - 'css/bootstrap/css/bootstrap.css', - 'components/open-sans-fontface/open-sans.css', + 'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.css', + 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/docs.css', 'css/animations.css' @@ -67,20 +73,20 @@ module.exports = function(config) { '../angular-sanitize.min.js', '../angular-touch.min.js', '../angular-animate.min.js', - 'components/marked/lib/marked.js', + 'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js', 'js/angular-bootstrap/bootstrap.js', 'js/angular-bootstrap/bootstrap-prettify.js', 'js/angular-bootstrap/dropdown-toggle.js', - 'components/lunr.js/lunr.min.js', - 'components/google-code-prettify/src/prettify.js', - 'components/google-code-prettify/src/lang-css.js', + 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', 'js/versions-data.js', 'js/pages-data.js', 'js/docs.js' ], stylesheets: [ - 'components/bootstrap/dist/css/bootstrap.css', - 'components/open-sans-fontface/open-sans.css', + 'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.min.css', + 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/docs.css', 'css/animations.css' @@ -96,20 +102,20 @@ module.exports = function(config) { cdnUrl + '/angular-sanitize.min.js', cdnUrl + '/angular-touch.min.js', cdnUrl + '/angular-animate.min.js', - 'components/marked/lib/marked.js', + 'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js', 'js/angular-bootstrap/bootstrap.js', 'js/angular-bootstrap/bootstrap-prettify.js', 'js/angular-bootstrap/dropdown-toggle.js', - 'components/lunr.js/lunr.min.js', - 'components/google-code-prettify/src/prettify.js', - 'components/google-code-prettify/src/lang-css.js', + 'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', + 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js', 'js/versions-data.js', 'js/pages-data.js', 'js/docs.js' ], stylesheets: [ - 'components/bootstrap/dist/css/bootstrap.css', - 'components/open-sans-fontface/open-sans.css', + 'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.min.css', + 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/docs.css', 'css/animations.css' |
