<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)
      # 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}"<commit_msg>default router no longer appends page rep name unless necessary<commit_after>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)
      # 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
        if filename == Nanoc::Page::DEFAULTS[:filename] and
           extension == Nanoc::Page::DEFAULTS[:extension]
          page_rep.page.path + "#{filename}-#{page_rep.name}.#{extension}"
        else
          page_rep.page.path + "#{filename}.#{extension}"
        end
{'fraction_non_alphanumeric': 0.09968051118210862, 'fraction_numerical': 0.0, 'mean_word_length': 3.1538461538461537, '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': '5368057', 'n_tokens_mistral': 442, 'n_tokens_neox': 432, 'n_words': 128}