module JekyllRedirectFrom::Redirectable

Module which can be mixed in to documents (and pages) to provide redirect_to and redirect_from helpers

Public Instance Methods

redirect_from() click to toggle source

Returns an array representing the relative paths to other documents which should be redirected to this document

# File lib/jekyll-redirect-from/redirectable.rb, line 19
def redirect_from
  if to_liquid["redirect_from"].is_a?(Array)
    to_liquid["redirect_from"].compact
  else
    [to_liquid["redirect_from"]].compact
  end
end
redirect_to() click to toggle source

Returns a string representing the relative path or URL to which the document should be redirected

# File lib/jekyll-redirect-from/redirectable.rb, line 9
def redirect_to
  if to_liquid["redirect_to"].is_a?(Array)
    to_liquid["redirect_to"].compact.first
  else
    to_liquid["redirect_to"]
  end
end