code: public static function initialize()
  	{
  		$objFilesystem = new Filesystem();
  		$container = System::getContainer();
  		$strCacheDir = $container->getParameter('kernel.cache_dir');
  
  		// Try to load from cache
  		if (file_exists($strCacheDir . '/contao/config/templates.php'))
  		{
  			self::addFiles(include $strCacheDir . '/contao/config/templates.php');
  		}
  		else
  		{
  			try
  			{
  				foreach (System::getContainer()->get('contao.resource_finder')->findIn('templates')->name('*.html5') as $file)
  				{
  					/** @var SplFileInfo $file */
  					self::addFile($file->getBasename('.html5'), rtrim($objFilesystem->makePathRelative($file->getPath(), $container->getParameter('kernel.project_dir')), '/'));
  				}
  			}
  			catch (\InvalidArgumentException $e) {}
  		}
  	}
docs: Find the templates in the Contao resource folders.