finish author system
This commit is contained in:
parent
db8669d30d
commit
fe6e01acdf
38 changed files with 614 additions and 73 deletions
|
|
@ -5,7 +5,7 @@ function createCategories($textsPage) {
|
|||
foreach ($textsPage->categories()->split() as $category) {
|
||||
$categories[$category] = array(
|
||||
'title' => $category,
|
||||
'texts' => array()
|
||||
'texts' => new Pages()
|
||||
);
|
||||
}
|
||||
return $categories;
|
||||
|
|
@ -16,7 +16,7 @@ function fillCategoriesWithTexts($emptyCategories, $texts) {
|
|||
foreach ($texts as $text) {
|
||||
try {
|
||||
$textCategory = $text->category()->value();
|
||||
$filledCategories[$textCategory]['texts'][] = $text;
|
||||
$filledCategories[$textCategory]['texts']->add($text);
|
||||
} catch (\Throwable $th) {
|
||||
throw new Exception(json_encode($th->getFile() . ' : ' . $th->getMessage()));
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ function fillCategoriesWithTexts($emptyCategories, $texts) {
|
|||
}
|
||||
|
||||
return function ($site) {
|
||||
$textsPage = $site->find('texts');
|
||||
$textsPage = $site->find('textes');
|
||||
$years = $textsPage->children();
|
||||
$texts = $years->children()->index();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue