Class: BuntoRedirectFrom::RedirectPage
- Inherits:
-
Bunto::Page
- Object
- Bunto::Page
- BuntoRedirectFrom::RedirectPage
- Defined in:
- lib/bunto-redirect-from/redirect_page.rb
Instance Method Summary collapse
- #generate_redirect_content(item_url) ⇒ Object
-
#initialize(site, base, dir, name) ⇒ RedirectPage
constructor
Initialize a new RedirectPage.
Constructor Details
#initialize(site, base, dir, name) ⇒ RedirectPage
Initialize a new RedirectPage.
site - The Site object. base - The String path to the source. dir - The String path between the source and the file. name - The String filename of the file.
11 12 13 14 15 16 17 18 19 |
# File 'lib/bunto-redirect-from/redirect_page.rb', line 11 def initialize(site, base, dir, name) @site = site @base = base @dir = dir @name = name self.process(name) self.data = {} end |
Instance Method Details
#generate_redirect_content(item_url) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/bunto-redirect-from/redirect_page.rb', line 21 def generate_redirect_content(item_url) self.output = self.content = <<-EOF <!DOCTYPE html> <meta charset="utf-8"> <title>Redirecting…</title> <link rel="canonical" href="#{item_url}"> <meta http-equiv="refresh" content="0; url=#{item_url}"> <h1>Redirecting…</h1> <a href="#{item_url}">Click here if you are not redirected.</a> <script>location="#{item_url}"</script> EOF end |