class Smeagol::Views::Form

The form view is used for generic files that are not Gollum wiki pages. These are typically html or xml files and they are rendered as mustache templates.

Public Instance Methods

content() click to toggle source

Public: Rendered content of the file.

# File lib/smeagol/views/form.rb, line 16
def content
  @content ||= Mustache.render(file.raw_data, self)
end
href() click to toggle source

Public: static href, used when generating static site.

# File lib/smeagol/views/form.rb, line 37
def href
  dir  = ::File.dirname(file.path)
  ext  = ::File.extname(file.path)

  if dir != '.'
    ::File.join(dir, name.chomp(ext)) #file.path)
  else
    if name == settings.index #|| 'Home'
      'index.html'
    else
      name.chomp(ext) #file.path
    end
  end
end
not_home?() click to toggle source

Public: A flag stating that this is not the home file.

# File lib/smeagol/views/form.rb, line 32
def not_home?
  filename != "index.html"
end
page_title()
Alias for: title
title() click to toggle source
# File lib/smeagol/views/form.rb, line 21
def title
  filename  # TODO: better idea for form title?
end
Also aliased as: page_title