diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml new file mode 100644 index 0000000..b47ed9d --- /dev/null +++ b/.github/workflows/draft.yml @@ -0,0 +1,25 @@ +name: Publish a Release Preview + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 + - run: | + sudo apt-get install zip -y + zip -r AntCMS.zip src + - uses: ncipollo/release-action@v1 + with: + artifacts: "AntCMS.zip" + prerelease: true + allowUpdates: true + artifactErrorsFailBuild: true + generateReleaseNotes: true + name: "Preview Build" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 1b01b6c..f17b4f4 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -17,4 +17,3 @@ jobs: with: configuration: phpstan.neon memory_limit: 256M - diff --git a/src/AntCMS/AntCMS.php b/src/AntCMS/AntCMS.php index 900dd21..8a3a19d 100644 --- a/src/AntCMS/AntCMS.php +++ b/src/AntCMS/AntCMS.php @@ -38,7 +38,7 @@ class AntCMS $end_time = microtime(true); $elapsed_time = round($end_time - $start_time, 4); - if($currentConfig['debug']){ + if ($currentConfig['debug']) { $pageTemplate = str_replace('', '

Took ' . $elapsed_time . ' seconds to render the page.

', $pageTemplate); } @@ -88,7 +88,11 @@ class AntCMS $currentConfig = AntConfig::currentConfig(); $themePath = antThemePath . '/' . $currentConfig['activeTheme']; $themeContent['default_layout'] = file_get_contents($themePath . '/default_layout.html'); - $themeContent['nav_layout'] = file_get_contents($themePath . '/nav_layout.html') ?? ''; + $themeContent['nav_layout'] = file_get_contents($themePath . '/nav_layout.html'); + + if (!$themeContent['nav_layout']) { + $themeContent['default_layout'] = ''; + } if (!$themeContent['default_layout']) { $themeContent['default_layout'] = ' @@ -143,7 +147,8 @@ class AntCMS return $pageHeaders; } - public static function getSiteInfo(){ + public static function getSiteInfo() + { $currentConfig = AntConfig::currentConfig(); return $currentConfig['SiteInfo']; }