Skip to content

Commit

Permalink
Single SiteMap for both image and page
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldreams committed Aug 25, 2019
1 parent 0eaa568 commit 29c4d63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Jobs/SitemapGeneratorJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct()
public function handle()
{
$siteMap = new SiteMap();
$siteMap->page()->image();
$siteMap->page();
}

}
4 changes: 4 additions & 0 deletions src/Services/SiteMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ private function singlePage($url, $page)
$url->addChild('lastmod', $page->getLastModifiedDate());
$url->addChild('changefreq', $page->getChangeFrequency());
$url->addChild('priority', $page->getPriority());
foreach ($page->pageImages as $image) {
$imageXml = $url->addChild('image:image', '', static::ImageNs);
$this->singleImage($imageXml, $image);
}
return $url;
}

Expand Down

0 comments on commit 29c4d63

Please sign in to comment.