code: def add_jinja2_ext(pelican):
      
  
      if 'JINJA_ENVIRONMENT' in pelican.settings: # pelican 3.7+
          pelican.settings['JINJA_ENVIRONMENT']['extensions'].append(AssetsExtension)
      else:
          pelican.settings['JINJA_EXTENSIONS'].append(AssetsExtension)
docs: Add Webassets to Jinja2 extensions in Pelican settings.