Class: Jekyll::URL

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll_relative_urls/jekyll/url.rb

Overview

Redefine la clase Jekyll::URL

Instance Method Summary collapse

Instance Method Details

#to_sObject

Eliminar la raíz de todas las URLs salvo en la raíz misma



26
27
28
29
30
31
32
# File 'lib/jekyll_relative_urls/jekyll/url.rb', line 26

def to_s
  # Igual que en jekyll-4.0.0/lib/jekyll/url.rb
  url = sanitize_url(generated_permalink || generated_url)
  url.gsub!(%r{^/}, '') unless url.length == 1

  url
end