Class: Jekyll::RedirectPage

Inherits:
Page
  • Object
show all
Defined in:
lib/jekyll-redirects.rb

Overview

a class for generating the redirect pages.

Instance Method Summary collapse

Constructor Details

#initialize(site, base, path, destination) ⇒ RedirectPage

Returns a new instance of RedirectPage.



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/jekyll-redirects.rb', line 42

def initialize(site, base, path, destination)

  @site = site
  @base = base
  @dir  = path
  @name = 'index.html'
  self.process(@name)

  # Read the YAML data from the layout page.
  self.read_yaml(File.join(base, '_layouts'), 'redirect.html')
  self.data['source_url'] = destination

end