Class: Hyphae::SiteLink

Inherits:
SiteNode show all
Defined in:
lib/hyphae.rb

Overview

A SiteLink represents an arbitrary link

Instance Attribute Summary

Attributes inherited from SiteNode

#date, #name, #order, #parent, #path, #slug

Instance Method Summary collapse

Methods inherited from SiteNode

#cmp, #root

Constructor Details

#initialize(filename, parent) ⇒ SiteLink

Returns a new instance of SiteLink.



151
152
153
154
# File 'lib/hyphae.rb', line 151

def initialize(filename, parent)
  super
  @link = File.read(filename).strip
end

Instance Method Details

#build(build_dir, template, options = {}) ⇒ Object

Builds html page (does nothing for a link)



164
165
# File 'lib/hyphae.rb', line 164

def build(build_dir, template, options={})
end

Builds the nav menu tag for this page



157
158
159
160
161
# File 'lib/hyphae.rb', line 157

def nav_link(open_path=[], options={})
  return "" if @hidden
  attrs = { 'class' => 'nav_link', 'href' => @link }
  Hyphae::make_tag('a', @name, attrs)
end