Use the .twig file extension

This commit is contained in:
Belle Aerni 2023-01-10 00:07:20 -08:00
parent 3405291db1
commit 2a1af73f75
11 changed files with 7 additions and 7 deletions

View file

@ -28,8 +28,8 @@ Here is an example of the default theme folder structure:
- `/Themes`
- `/Default`
- `/Templates`
- `default_layout.html`
- `nav_layout.html`
- `default_layout.html.twig`
- `nav_layout.html.twig`
- `/Assets`
- `tailwind.css`

View file

@ -111,10 +111,10 @@ class AntCMS
$templates = AntTools::getFileList($templatePath, 'html');
try {
if (in_array($layout . '.html', $templates)) {
$template = file_get_contents(AntTools::repairFilePath($templatePath . '/' . $layout . '.html'));
if (in_array($layout . '.html.twig', $templates)) {
$template = file_get_contents(AntTools::repairFilePath($templatePath . '/' . $layout . '.html.twig'));
} else {
$template = file_get_contents(AntTools::repairFilePath($defaultTemplates . '/' . $layout . '.html'));
$template = file_get_contents(AntTools::repairFilePath($defaultTemplates . '/' . $layout . '.html.twig'));
}
} catch (\Exception $e) {
}

View file

@ -31,8 +31,8 @@ Here is an example of the default theme folder structure:
- `/Themes`
- `/Default`
- `/Templates`
- `default_layout.html`
- `nav_layout.html`
- `default_layout.html.twig`
- `nav_layout.html.twig`
- `/Assets`
- `tailwind.css`