<commit_before>angular.module('Sprangular.StaticContent')
  .config ($routeProvider) ->
    $routeProvider.when '/pages/:slug*',
      controller: 'PageShowCtrl'
      templateUrl: 'pages/show.html'
      resolve:
        page: (StaticContent, $route)->
          slug = $route.current.params.slug
          StaticContent.find(slug)

Sprangular.StaticContent =
  addRoutes: (routeProvider) ->
    routeProvider.when '/:slug*',
      controller: 'PageShowCtrl'
      templateUrl: 'pages/show.html'
      resolve:
        page: (StaticContent, $route, $location)->
          slug = $route.current.params.slug

          StaticContent.find(slug).then (->), ->
            $location.path('/404')<commit_msg>Redirect directly to /not-found when page missing<commit_after>angular.module('Sprangular.StaticContent')
  .config ($routeProvider) ->
    $routeProvider.when '/pages/:slug*',
      controller: 'PageShowCtrl'
      templateUrl: 'pages/show.html'
      resolve:
        page: (StaticContent, $route)->
          slug = $route.current.params.slug
          StaticContent.find(slug)

Sprangular.StaticContent =
  addRoutes: (routeProvider) ->
    routeProvider.when '/:slug*',
      controller: 'PageShowCtrl'
      templateUrl: 'pages/show.html'
      resolve:
        page: (StaticContent, $route, $window)->
          slug = $route.current.params.slug

          StaticContent.find(slug).then (->), ->
            $window.location.href = "/not-found"
{'fraction_non_alphanumeric': 0.1437414030261348, 'fraction_numerical': 0.0020632737276478678, 'mean_word_length': 2.7403598971722367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4668744', 'n_tokens_mistral': 433, 'n_tokens_neox': 434, 'n_words': 74}