File tree Expand file tree Collapse file tree 4 files changed +7
-2
lines changed
Resources/templates/content Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,11 @@ public function getIndexPage(): string
7070 $ indexPage = null ;
7171
7272 if ($ this ->siteConfig ->site_index !== null ) {
73+ $ pageTpl = $ this ->siteConfig ->site_index_tpl ?? 'content/single.html.twig ' ;
7374 $ page = $ this ->contentProvider ->fetch ($ this ->siteConfig ->site_index );
74- $ indexPage = $ this ->getSinglePage ($ page );
75+ $ indexPage = $ this ->twigServiceProvider ->render ($ pageTpl , [
76+ 'content ' => $ page ,
77+ ]);
7578 }
7679
7780 if ($ indexPage === null ) {
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ function getCustomIndexPageApp(): App
9090{
9191 $ config = getDefaultAppConfig ();
9292 $ config ['site_index ' ] = 'posts/test0 ' ;
93+ $ config ['site_index_tpl ' ] = 'content/index.html.twig ' ;
9394
9495 $ app = new App ($ config );
9596 $ app ->addService ('builder ' , new StaticBuilder ());
Original file line number Diff line number Diff line change 1+ template index
Original file line number Diff line number Diff line change 4646 expect (is_file ($ app ->builder ->outputPath . '/index.html ' ))->toBeTrue ();
4747
4848 $ content = file_get_contents ($ app ->builder ->outputPath . '/index.html ' );
49- expect ($ content )->toMatch ("/template single / " );
49+ expect ($ content )->toMatch ("/template index / " );
5050});
5151
5252test ('StaticBuilder builds paginated tag pages ' , function () {
You can’t perform that action at this time.
0 commit comments