|
@@ -66,18 +66,18 @@ class LiquidTagCollection extends AbstractBlock
|
|
|
return ''; // 如果没有找到页面,返回空字符串
|
|
|
}
|
|
|
|
|
|
-// $pagesData = [];
|
|
|
-// $items = $pages->items();
|
|
|
-// if ($items) {
|
|
|
-// $i = 0;
|
|
|
-// foreach ($items as $item) {
|
|
|
-// $pagesData[$i] = $item;
|
|
|
-// $pagesData[$i]['tags'] = $item->tags->toArray();
|
|
|
-// $i++;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ $pagesData = [];
|
|
|
+ $items = $pages->items();
|
|
|
+ if ($items) {
|
|
|
+ $i = 0;
|
|
|
+ foreach ($items as $item) {
|
|
|
+ $pagesData[$i] = $item;
|
|
|
+ $pagesData[$i]['tags'] = $item->tags->toArray();
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
// 如果有文章,渲染模板
|
|
|
- return $this->renderTemplate(['pages' => $pages->items()]);
|
|
|
+ return $this->renderTemplate(['pages' => $pagesData]);
|
|
|
}
|
|
|
|
|
|
// 渲染模板
|