code: func AddContextRoot(baseURL, relativePath string) string {
  
  	url, err := url.Parse(baseURL)
  	if err != nil {
  		panic(err)
  	}
  
  	newPath := path.Join(url.Path, relativePath)
  
  	// path strips traling slash, ignore root path.
  	if newPath != "/" && strings.HasSuffix(relativePath, "/") {
  		newPath += "/"
  	}
  	return newPath
  }
docs: // AddContextRoot adds the context root to an URL if it's not already set.
  // For relative URL entries on sites with a base url with a context root set (i.e. http://example.com/mysite),
  // relative URLs must not include the context root if canonifyURLs is enabled. But if it's disabled, it must be set.