def target_path(path)
      parts = File.basename(path.to_s).split(".")
      path = path.to_s

      # Always return .html directly as it will cause too much trouble otherwise
      return Pathname.new(path) if parts.last == "html"

      target_ext = Roger::Renderer.target_extension_for(path)
      source_ext = Roger::Renderer.source_extension_for(path)

      # If there is no target extension
      return Pathname.new(path) if target_ext.empty?

      # If we have at least one extension
      if parts.size > 1
        source_ext_regexp = /#{Regexp.escape(source_ext)}\Z/
        Pathname.new(path.gsub(source_ext_regexp, target_ext))
      else
        Pathname.new(path + "." + target_ext)
      end
    end
def target_path(path)
      parts = File.basename(path.to_s).split(".")
      path = path.to_s

      # Always return .html directly as it will cause too much trouble otherwise
      return Pathname.new(path) if parts.last == "html"

      target_ext = Roger::Renderer.target_extension_for(path)
      source_ext = Roger::Renderer.source_extension_for(path)

      # If there is no target extension
      return Pathname.new(path) if target_ext.empty?

      # If we have at least one extension
      if parts.size > 1
        source_ext_regexp = /#{Regexp.escape(source_ext)}\Z/
        Pathname.new(path.gsub(source_ext_regexp, target_ext))
      else
        Pathname.new(path + "." + target_ext)
      end
    end
Determines the output path for a mockup path with a certain template

 @return [Pathname]