def set_paths(from, to)
      @context ||= context
      from = ensure_leading_slash(from)
      data.merge!(
        "permalink" => from,
        "redirect"  => {
          "from" => from,
          "to"   => to =~ %r!^https?://! ? to : absolute_url(to),
        }
      )
    end
def set_paths(from, to)
      @context ||= context
      from = ensure_leading_slash(from)
      data.merge!(
        "permalink" => from,
        "redirect"  => {
          "from" => from,
          "to"   => to =~ %r!^https?://! ? to : absolute_url(to),
        }
      )
    end
Helper function to set the appropriate path metadata

 from - the relative path to the redirect page
 to   - the relative path or absolute URL to the redirect target