@ -23,15 +23,17 @@ class Sorting
$pages = (new Book('../content/pages'))->getContents();
$pages = (new Book('../content/pages'))->getContents();
foreach ($pages as $page) {
foreach ($pages as $page) {
$temp = [];
$temp = [];
$temp = explode(',', $page['tags']);
if (isset($page['tags'])) {
foreach ($temp as $tag) {
$temp = explode(',', $page['tags']);
$label = trim($tag);
foreach ($temp as $tag) {
if (!find(self::$p_tags, ['tag_name' => $label])) {
$label = trim($tag);
array_push(self::$p_tags, [
if (!find(self::$p_tags, ['tag_name' => $label])) {
'tag_name' => $label,
array_push(self::$p_tags, [
'slug' => StringTools::safeString($label),
'tag_name' => $label,
'pages' => self::tagPages($label, $pages),
'slug' => StringTools::safeString($label),
]);
'pages' => self::tagPages($label, $pages),
]);
}
}
}
}
}
}
}
@ -43,13 +45,15 @@ class Sorting
{
{
$tagged = [];
$tagged = [];
foreach ($pages as $page) {
foreach ($pages as $page) {
if (strpos($page['tags'], $tag) !== false) {
if (isset($page['tags'])) {
array_push($tagged, [
if (strpos($page['tags'], $tag) !== false) {
'title' => $page['title'],
array_push($tagged, [
'slug' => $page['slug'],
'title' => $page['title'],
'path' => $page['path'],
'slug' => $page['slug'],
'feature' => $page['feature'],
'path' => $page['path'],
]);
'feature' => $page['feature'],
]);
}
}
}
}
}
@ -124,15 +128,16 @@ class Sorting
'image' => $settings['global']['base_url'] . $settings['global']['background'],
'image' => $settings['global']['base_url'] . $settings['global']['background'],
'baseURL' => $settings['global']['base_url'],
'baseURL' => $settings['global']['base_url'],
];
];
$tags = [];
$taglist = explode(',', $page['tags']);
if (isset($page['tags'])) {
$tags = [];
$taglist = explode(',', $page['tags']);
foreach ($taglist as $tag) {
foreach ($taglist as $tag) {
$label = trim($tag);
$label = trim($tag);
array_push($tags, [
array_push($tags, [
'label' => $label . ' ',
'label' => $label . ' ',
'slug' => StringTools::safeString($label),
'slug' => StringTools::safeString($label),
]);
]);
}
}
}
$meta = [
$meta = [