<commit_before>module Nanoc::Routers

  # The default router organises pages in the most obvious, but sometimes
  # slightly restrictive, way: the hierarchy of compiled pages is the same as
  # the hierarchy of uncompiled pages.
  class Default < Nanoc::Router

    identifier :default

    def path_for_page_rep(page_rep)
      # Get data we need
      filename   = page_rep.attribute_named(:filename)
      extension  = page_rep.attribute_named(:extension)

      # Build path
      if page_rep.name == :default
        page_rep.page.path + "#{filename}.#{extension}"
      else
        page_rep.page.path + "#{filename}-#{page_rep.name}.#{extension}"
      end
    end

    def path_for_asset_rep(asset_rep)
      # Get data we need
      extension     = asset_rep.attribute_named(:extension)
      modified_path = asset_rep.asset.path[0..-2]

      # Build path
      if asset_rep.name == :default
        modified_path + '.' + extension
      else
        modified_path + '-' + asset_rep.name.to_s + '.' + extension
      end
    end

  end

end<commit_msg>default router now stores assets under /assets (can be overridden)<commit_after>module Nanoc::Routers

  # The default router organises pages in the most obvious, but sometimes
  # slightly restrictive, way: the hierarchy of compiled pages and assets is
  # the same as the hierarchy of uncompiled pages and assets.
  class Default < Nanoc::Router

    identifier :default

    def path_for_page_rep(page_rep)
      # Get data we need
      filename   = page_rep.attribute_named(:filename)
      extension  = page_rep.attribute_named(:extension)

      # Build path
      path = page_rep.page.path + filename
      if page_rep.name == :default
        path += '.' + extension
      else
        path += page_rep.name.to_s + '.' + extension
      end

      path
    end

    def path_for_asset_rep(asset_rep)
      # Get data we need
      extension     = asset_rep.attribute_named(:extension)
      modified_path = asset_rep.asset.path[0..-2]

      # Build path
      assets_prefix = @site.config[:assets_prefix] || '/assets'
      path = assets_prefix + modified_path
      if asset_rep.name == :default
        path += '.' + extension
      else
        path += '-' + asset_rep.name.to_s + '.' + extension
      end

      path
    end

  end

end
{'fraction_non_alphanumeric': 0.0907911802853437, 'fraction_numerical': 0.0017293558149589277, 'mean_word_length': 2.549079754601227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '748031', 'n_tokens_mistral': 693, 'n_tokens_neox': 669, 'n_words': 188}