code: func NewPathSpecWithBaseBaseFsProvided(fs *hugofs.Fs, cfg config.Provider, baseBaseFs *filesystems.BaseFs) (*PathSpec, error) {
  
  	p, err := paths.New(fs, cfg)
  	if err != nil {
  		return nil, err
  	}
  
  	var options []func(*filesystems.BaseFs) error
  	if baseBaseFs != nil {
  		options = []func(*filesystems.BaseFs) error{
  			filesystems.WithBaseFs(baseBaseFs),
  		}
  	}
  	bfs, err := filesystems.NewBase(p, options...)
  	if err != nil {
  		return nil, err
  	}
  
  	ps := &PathSpec{
  		Paths:           p,
  		BaseFs:          bfs,
  		Fs:              fs,
  		Cfg:             cfg,
  		ProcessingStats: NewProcessingStats(p.Lang()),
  	}
  
  	basePath := ps.BaseURL.Path()
  	if basePath != "" && basePath != "/" {
  		ps.BasePath = basePath
  	}
  
  	return ps, nil
  }
docs: // NewPathSpecWithBaseBaseFsProvided creats a new PathSpec from the given filesystems and language.
  // If an existing BaseFs is provided, parts of that is reused.