Sha256: 7ab6349bb0f8a6d5d677ef3c0433eda8f6b7f60e66af6fa3047cc1ecc9ff6a4e

Contents?: true

Size: 858 Bytes

Versions: 3

Compression:

Stored size: 858 Bytes

Contents

module JekyllRedirectFrom
  class RedirectPage < Jekyll::Page
    # 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.
    def initialize(site, base, dir, name)
      @site = site
      @base = base
      @dir  = dir
      @name = name

      self.process(name)
      self.data = {}
    end

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-redirect-from-0.9.0 lib/jekyll-redirect-from/redirect_page.rb
jekyll-redirect-from-0.8.0 lib/jekyll-redirect-from/redirect_page.rb
jekyll-redirect-from-0.7.0 lib/jekyll-redirect-from/redirect_page.rb