Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| HtmlPage | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| contents | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| compile | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getBladeView | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Pages; |
| 6 | |
| 7 | use Hyde\Pages\Concerns\HydePage; |
| 8 | |
| 9 | /** |
| 10 | * Page class for HTML pages. |
| 11 | * |
| 12 | * Html pages are stored in the _pages directory and using the .html extension. |
| 13 | * These pages will be copied exactly as they are to the _site/ directory. |
| 14 | * |
| 15 | * @see https://hydephp.com/docs/1.x/static-pages#bonus-creating-html-pages |
| 16 | */ |
| 17 | class HtmlPage extends HydePage |
| 18 | { |
| 19 | public static string $sourceDirectory = '_pages'; |
| 20 | public static string $outputDirectory = ''; |
| 21 | public static string $fileExtension = '.html'; |
| 22 | |
| 23 | public function contents(): string |
| 24 | { |
| 25 | return file_get_contents($this->getSourcePath()); |
| 26 | } |
| 27 | |
| 28 | public function compile(): string |
| 29 | { |
| 30 | return $this->contents(); |
| 31 | } |
| 32 | |
| 33 | public function getBladeView(): string |
| 34 | { |
| 35 | return $this->getSourcePath(); |
| 36 | } |
| 37 | } |