Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #456 from KnpLabs/fix/sitemap-generator
Browse files Browse the repository at this point in the history
Fix sitemap generation
  • Loading branch information
Yann Rabiller committed Mar 17, 2015
2 parents 82acb58 + d2e3613 commit c72a384
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Knp/Bundle/SitemapBundle/Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ protected function execute(InputInterface $input, OutputInterface $output)

$output->write('<info>Fetching resources..</info>' . PHP_EOL);
$dql = <<<___SQL
SELECT b.name, b.username, b.updatedAt FROM KnpBundlesBundle:Bundle b
SELECT b.name, b.ownerName, b.updatedAt FROM KnpBundlesBundle:Bundle b
___SQL;
$q = $em->createQuery($dql);
$bundles = $q->getArrayResult();

$dql = <<<___SQL
SELECT u.name, u.createdAt FROM KnpBundlesBundle:User u
SELECT d.name, d.createdAt FROM KnpBundlesBundle:Developer d
___SQL;
$q = $em->createQuery($dql);
$users = $q->getArrayResult();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<loc>{{ path('bundle_show', {'username': bundle.username, 'name': bundle.name})|kb_sitemap_url_absolute }}</loc>
<loc>{{ path('bundle_show', {'ownerName': bundle.ownerName, 'name': bundle.name})|kb_sitemap_url_absolute }}</loc>
<lastmod>{{ bundle.updatedAt|kb_sitemap_date }}</lastmod>
{#<priority>{{ bundle.score }}</priority>#}
<changefreq>daily</changefreq>
<changefreq>daily</changefreq>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<loc>{{ path('user_show', {'name': user.name})|kb_sitemap_url_absolute }}</loc>
<loc>{{ path('developer_show', {'name': user.name})|kb_sitemap_url_absolute }}</loc>
<lastmod>{{ user.createdAt|kb_sitemap_date }}</lastmod>
<changefreq>weekly</changefreq>
<changefreq>weekly</changefreq>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% spaceless %}
{% include 'KnpSitemapBundle::sitemap.xml.twig' with { 'bundles': bundles, 'users': users } %}
{% endspaceless %}
{% endspaceless %}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
{% include "KnpSitemapBundle:Url:user_bundles.xml.twig" with { 'user': user } %}
</url>#}
{% endfor %}
</urlset>
</urlset>

0 comments on commit c72a384

Please sign in to comment.