Skip to content

Commit 6f9630d

Browse files
authored
Don't cobble together paths, use the url_generator, as we should.
1 parent 6fda428 commit 6f9630d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SitemapExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ private function getLinks()
135135
$config = $this->getConfig();
136136
$contentTypes = $app['config']->get('contenttypes');
137137
$contentParams = ['limit' => 10000, 'order' => 'datepublish desc', 'hydrate' => false];
138-
$rootPath = $app['url_generator']->generate('homepage');
139138

140139
$links = [
141140
[
142-
'link' => $rootPath,
141+
'link' => $app['url_generator']->generate('homepage'),
143142
'title' => $app['config']->get('general/sitename'),
144143
],
145144
];
@@ -160,8 +159,9 @@ private function getLinks()
160159
'depth' => 1,
161160
];
162161
}else{
162+
$link = $app['url_generator']->generate('contentlisting', ['contenttypeslug' => $contentType['slug']]);
163163
$links[] = [
164-
'link' => $rootPath . '/' . $contentType['slug'],
164+
'link' => $link,
165165
'title' => $contentType['name'],
166166
'depth' => 1,
167167
];

0 commit comments

Comments
 (0)