Sha256: 0ded5934be29eaece429cd6cc8a864395b95cda0cdc0cf8cf651f9244972b4a8

Contents?: true

Size: 228 Bytes

Versions: 5

Compression:

Stored size: 228 Bytes

Contents

# frozen_string_literal: true

module UrlHelper
  def format_url(url)
    formatted = url.gsub('index.html', '')
                   .sub(%r{^/}, '')
                   .chomp('/')

    "/#{formatted}/".gsub('//', '/')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
frontman-ssg-0.1.1 lib/frontman/helpers/url_helper.rb
frontman-ssg-0.1.0 lib/frontman/helpers/url_helper.rb
frontman-ssg-0.0.4 lib/frontman/helpers/url_helper.rb
frontman-ssg-0.0.3 lib/frontman/helpers/url_helper.rb
frontman-ssg-0.0.2 lib/frontman/helpers/url_helper.rb