Guest User

Untitled

a guest
Feb 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. # This function helps to build a relative path from the page to the output root.
  2. #
  3. # Usage: <img src="<%= page_depth @page.path %>images/hardon.png" alt="wadus" />
  4. def page_depth path
  5. depth = ""
  6. (path.split("/").size-1).times do
  7. depth = depth + "../"
  8. end
  9. depth
  10. end
Add Comment
Please, Sign In to add comment