angular.module('gcloud.docs')
  .value('pages', {

    //---------------------------------------------
    // Link schema:
    //---------------------------------------------
    // key: {
    //   title: 'Display Name for Link',
    //   _url: '{baseUrl}/module-name',
    //
    //   pages: [
    //     title: 'Display Name for Sub-Page Link',
    //     url: '/path-relevant-to-parent-url'
    //   ]
    // }
    //---------------------------------------------

    gcloud: {
      title: 'gcloud',
      _url: '{baseUrl}'
    },

    datastore: {
      title: 'Datastore',
      _url: '{baseUrl}/datastore',
      pages: [
        {
          title: 'Dataset',
          url: '/dataset'
        },
        {
          title: 'Query',
          url: '/query'
        }
      ]
    },

    datastoreWithTransaction: {
      title: 'Datastore',
      _url: '{baseUrl}/datastore',
      pages: [
        {
          title: 'Dataset',
          url: '/dataset'
        },
        {
          title: 'Transaction',
          url: '/transaction'
        },
        {
          title: 'Query',
          url: '/query'
        }
      ]
    },

    pubsub: {
      title: 'PubSub',
      _url: '{baseUrl}/pubsub',
      pages: [
        {
          title: 'Topic',
          url: '/topic'
        },
        {
          title: 'Subscription',
          url: '/subscription'
        }
      ]
    },

    storage: {
      title: 'Storage',
      _url: '{baseUrl}/storage'
    },

    VERSIONS: {
      // Give a version with/without a comparator, anything semver:
      //   https://github.com/npm/node-semver#versions
      //
      // Multiple keys may be used to match a version.
      //
      // Example:
      // A user is browsing the docs for 0.7.0. If the list below contains the
      // keys: "*", ">0.4.0", and "0.7.0", all of the contents will be joined.
      //
      // Notes on ordering:
      // These are sorted alphabetically by `module`.title.
      //
      // To keep the documentation for the main module, `gcloud`, on top of the
      // link list, **make sure the title is `gcloud`**
      '*': ['gcloud', 'storage'],
      '<0.8.0': ['datastore'],
      '>=0.8.0': ['datastoreWithTransaction', 'pubsub']
    }
  });

@@ -1477,142 +1477,272 @@
     
-VERSIONS: %7B%0A      // Give a version with/without a comparator, anything semver:%0A      //   https://github.com/npm/node-semver#versions
+storageWithFiles: %7B%0A      title: 'Storage',%0A      _url: '%7BbaseUrl%7D/storage',%0A      pages: %5B%0A        %7B%0A          title: 'Bucket',%0A          url: '/bucket'%0A        %7D,%0A        %7B%0A          title: 'File',%0A          url: '/file'%0A        %7D%0A      %5D%0A    %7D,%0A%0A    VERSIONS: %7B
 %0A   
@@ -2253,106 +2253,325 @@
 oud'
-, 'storage'%5D,%0A      '%3C0.8.0': %5B'datastore'%5D,%0A      '%3E=0.8.0': %5B'datastoreWithTransaction', 'pubsub
+%5D,%0A%0A      // deprecate old datastore api.%0A      '%3C0.8.0': %5B'datastore'%5D,%0A%0A      // introduce datastore refactor + pubsub.%0A      '%3E=0.8.0': %5B'datastoreWithTransaction', 'pubsub'%5D,%0A%0A      // deprecate old storage api.%0A      '%3C0.9.0': %5B'storage'%5D,%0A%0A      // introduce new storage api.%0A      '%3E=0.9.0': %5B'storageWithFiles
 '%5D%0A 

update doc api versions.