Skip to content

Commit

Permalink
Don't cobble together paths, use the url_generator, as we should.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter authored Jun 19, 2017
1 parent 6fda428 commit 6f9630d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SitemapExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ private function getLinks()
$config = $this->getConfig();
$contentTypes = $app['config']->get('contenttypes');
$contentParams = ['limit' => 10000, 'order' => 'datepublish desc', 'hydrate' => false];
$rootPath = $app['url_generator']->generate('homepage');

$links = [
[
'link' => $rootPath,
'link' => $app['url_generator']->generate('homepage'),
'title' => $app['config']->get('general/sitename'),
],
];
Expand All @@ -160,8 +159,9 @@ private function getLinks()
'depth' => 1,
];
}else{
$link = $app['url_generator']->generate('contentlisting', ['contenttypeslug' => $contentType['slug']]);
$links[] = [
'link' => $rootPath . '/' . $contentType['slug'],
'link' => $link,
'title' => $contentType['name'],
'depth' => 1,
];
Expand Down

0 comments on commit 6f9630d

Please sign in to comment.