/** @var Cubist\Backpack\app\Magic\Menu\Item[] $pages */
$pages = Menu::getNavigation()->findAll();
+ $indexed = [];
+
foreach ($pages as $page) {
// Skip nav items
if ($page instanceof VirtualItem) {
}
$href = $page->getHref();
- if ($href == '#') {
+ if ($href == '#' || $href=='home') {
continue;
}
$url = action("PageController@catchall", ['page' => $href]);
+ if (isset($indexed[$url])) {
+ continue;
+ }
$html = @file_get_contents($url);
if (!$html) {
'id' => $url,
];
+ echo $href . ' : ' . $url . "\n";
+ $indexed[$url] = true;
+
Elasticsearch::index($data);
}
}
public function getHref()
{
-
if ($this->getPage()->template == 'first_redirection' && $this->hasChildren()) {
return $this->getChildren()[0]->getHref();
} else if ($this->getPage()->template == 'internal_redirection') {