def normalize_title(site_title, title, separator, reverse = false)
      title = cleanup_strings(title)
      title.reverse! if reverse

      site_title = cleanup_string(site_title)
      separator = cleanup_string(separator, strip: false)

      # Truncate title and site title
      site_title, title = truncate_title(site_title, title, separator)

      if site_title.present?
        if reverse
          title.push(site_title)
        else
          title.unshift(site_title)
        end
      end
      safe_join(title, separator)
    end
def normalize_title(site_title, title, separator, reverse = false)
      title = cleanup_strings(title)
      title.reverse! if reverse

      site_title = cleanup_string(site_title)
      separator = cleanup_string(separator, strip: false)

      # Truncate title and site title
      site_title, title = truncate_title(site_title, title, separator)

      if site_title.present?
        if reverse
          title.push(site_title)
        else
          title.unshift(site_title)
        end
      end
      safe_join(title, separator)
    end
rubocop:disable Style/ModuleFunction
 Normalize title value.

 @param [String] site_title site title.
 @param [String, Array<String>] title title string.
 @param [String] separator a string to join title parts with.
 @param [true,false] reverse whether title should be reversed.
 @return [Array<String>] array of title parts with tags removed.