     controller: 'BlogController'
     notFoundTemplate: 'blogNotFound'
 
-    onBeforeAction: ->
+    onRun: ->
       if Blog.settings.blogShowTemplate
         @template = Blog.settings.blogShowTemplate
 

    path: '/blog'
    controller: 'BlogController'

    onBeforeAction: ->
      if Blog.settings.blogIndexTemplate
        @template = Blog.settings.blogIndexTemplate

      if not Session.get('postLimit') and Blog.settings.pageSize
        Session.set 'postLimit', Blog.settings.pageSize

      @subscribe('posts', Session.get('postLimit')).wait()

    waitOn: ->
      Meteor.subscribe 'authors'

    fastRender: true


    path: '/admin/blog'
    controller: 'BlogController'

    onRun: ->
      if Blog.settings.blogAdminTemplate
        @template = Blog.settings.blogAdminTemplate

    onBeforeAction: (pause) ->
      if Meteor.loggingIn()
        return pause()

