thecocktail (owner)

Revisions

gist: 8887 Download_button fork
public
Description:
Nanoc plugin to solve usual problems working with nanoc projects
Public Clone URL: git://gist.github.com/8887.git
Embed All Files: show embed
page_helper.rb #
1
2
3
4
5
6
7
8
9
10
# 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