Created
September 4, 2008 21:58
-
-
Save thecocktail/8887 to your computer and use it in GitHub Desktop.
Nanoc plugin to solve usual problems working with nanoc projects
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
# This function helps to build a relative path from the page to the output root. | |
# | |
# Usage: <img src="<%= page_depth @page.path %>images/hardon.png" alt="wadus" /> | |
def page_depth path | |
depth = "" | |
(path.split("/").size-1).times do | |
depth = depth + "../" | |
end | |
depth | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment