code: func NewFrontmatterHandler(logger *loggers.Logger, cfg config.Provider) (FrontMatterHandler, error) {
  
  	if logger == nil {
  		logger = loggers.NewErrorLogger()
  	}
  
  	frontMatterConfig, err := newFrontmatterConfig(cfg)
  	if err != nil {
  		return FrontMatterHandler{}, err
  	}
  
  	allDateKeys := make(map[string]bool)
  	addKeys := func(vals []string) {
  		for _, k := range vals {
  			if !strings.HasPrefix(k, ":") {
  				allDateKeys[k] = true
  			}
  		}
  	}
  
  	addKeys(frontMatterConfig.date)
  	addKeys(frontMatterConfig.expiryDate)
  	addKeys(frontMatterConfig.lastmod)
  	addKeys(frontMatterConfig.publishDate)
  
  	f := FrontMatterHandler{logger: logger, fmConfig: frontMatterConfig, allDateKeys: allDateKeys}
  
  	if err := f.createHandlers(); err != nil {
  		return f, err
  	}
  
  	return f, nil
  }
docs: // NewFrontmatterHandler creates a new FrontMatterHandler with the given logger and configuration.
  // If no logger is provided, one will be created.