-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from denbatte/feature/sitemapUpdate
[SitemapBundle] Make use of a sitemapindex and sub sitemaps
- Loading branch information
Showing
3 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# UPGRADE FROM 3.1 to 3.2 | ||
|
||
## Manual upgrade needed in app/routes to refactor sitemaps | ||
|
||
### WHAT | ||
This feature generates one central sitemap.xml file at your document root to define a sub sitemap for each language available. | ||
You can now have up to 50000 urls for each language you define. | ||
As a bonus, you only have to register the sitemap index (/sitemap.xml) at the search engines to register all available languages. | ||
|
||
### HOW | ||
In order to upgrade, you need a new route in your app/config/routes.yml. | ||
```yml | ||
KunstmaanSitemapBundle_sitemapIndex: | ||
resource: "@KunstmaanSitemapBundle/Controller/SitemapController.php" | ||
type: annotation | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/Kunstmaan/SitemapBundle/Resources/views/SitemapIndex/view.xml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
{% for locale in locales %} | ||
<sitemap> | ||
<loc>{{ host }}/sitemap-{{ locale }}.xml</loc> | ||
</sitemap> | ||
{% endfor %} | ||
</sitemapindex> |