This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Jekyll::Page | |
def relative | |
length = url.split("/").length | |
if (length > 0) | |
length = length - 1 | |
("../" * length)[0...-1] | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Jekyll::Page | |
def relative | |
("../" * (url.split("/").length-1))[1...-1] | |
end | |
def to_liquid(attrs = ATTRIBUTES_FOR_LIQUID) | |
super(attrs + %w[ | |
relative | |
]) |