code: func (c *PageCollections) getPageNew(context page.Page, ref string) (page.Page, error) {
  	var anError error
  
  	ref = strings.ToLower(ref)
  
  	// Absolute (content root relative) reference.
  	if strings.HasPrefix(ref, "/") {
  		p, err := c.getFromCache(ref)
  		if err == nil && p != nil {
  			return p, nil
  		}
  		if err != nil {
  			anError = err
  		}
  
  	} else if context != nil {
  		// Try the page-relative path.
  		ppath := path.Join("/", strings.ToLower(context.SectionsPath()), ref)
  		p, err := c.getFromCache(ppath)
  		if err == nil && p != nil {
  			return p, nil
  		}
  		if err != nil {
  			anError = err
  		}
  	}
  
  	if !strings.HasPrefix(ref, "/") {
  		// Many people will have "post/foo.md" in their content files.
  		p, err := c.getFromCache("/" + ref)
  		if err == nil && p != nil {
  			if context != nil {
  				// TODO(bep) remove this case and the message below when the storm has passed
  				err := wrapErr(errors.New(`make non-relative ref/relref page reference(s) in page %q absolute, e.g. {{< ref "/blog/my-post.md" >}}`), context)
  				helpers.DistinctWarnLog.Println(err)
  			}
  			return p, nil
  		}
  		if err != nil {
  			anError = err
  		}
  	}
  
  	// Last try.
  	ref = strings.TrimPrefix(ref, "/")
  	p, err := c.getFromCache(ref)
  	if err != nil {
  		anError = err
  	}
  
  	if p == nil && anError != nil {
  		return nil, wrapErr(errors.Wrap(anError, "failed to resolve ref"), context)
  	}
  
  	return p, nil
  }
docs: // Case insensitive page lookup.