lib/amber/static_page/render.rb
def symlink(from_path, to_path)
      to_path = realpath(to_path)
      target = from_path.relative_path_from(to_path).to_s.sub(/^\.\.\//, '')
      if !to_path.dirname.directory?
        Amber.logger.warn { "On page `#{@file_path}`, the parent directories for alias name `#{to_path}` don't exist. Skipping alias." }
        return
      end
      if to_path.exist? && to_path.symlink?
        File.unlink(to_path)
      end
      if !to_path.exist?
        Amber.logger.debug { "Symlink #{to_path} => #{target}" }
        FileUtils.ln_s(target, to_path)
      end
    end
def symlink(from_path, to_path)
      to_path = realpath(to_path)
      target = from_path.relative_path_from(to_path).to_s.sub(/^\.\.\//, '')
      if !to_path.dirname.directory?
        Amber.logger.warn { "On page `#{@file_path}`, the parent directories for alias name `#{to_path}` don't exist. Skipping alias." }
        return
      end
      if to_path.exist? && to_path.symlink?
        File.unlink(to_path)
      end
      if !to_path.exist?
        Amber.logger.debug { "Symlink #{to_path} => #{target}" }
        FileUtils.ln_s(target, to_path)
      end
    end
create a symlink. arguments must be of type Pathname.