svc / sitemap-bundle
Bundle to create easy XML sitemaps and robots.txt files
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8
- symfony/console: ^6.0|^7.0
- symfony/framework-bundle: ^6.0|^7.0
- symfony/yaml: ^6.0|^7.0
Requires (Dev)
- phpstan/phpstan: ^2
- phpunit/phpunit: ^11
README
This bundle create an easy XML sitemap and robots.txt in a Symfony application
Caution
The bundle is still at a very early stage, errors may occur!
Short examples
sitemap.xml
<?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://shorter.li/svc-contactform/de/contact/</loc> <lastmod>2024-12-09T15:07:58+01:00</lastmod> <changefreq>weekly</changefreq> <priority>0.2</priority> <xhtml:link rel="alternate" hreflang="de" href="https://shorter.li/svc-contactform/de/contact/"/> <xhtml:link rel="alternate" hreflang="en" href="https://shorter.li/svc-contactform/en/contact/"/> </url> <url> <loc>https://shorter.li/de/</loc> <lastmod>2024-12-09T15:07:58+01:00</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> <xhtml:link rel="alternate" hreflang="de" href="https://shorter.li/de/"/> <xhtml:link rel="alternate" hreflang="en" href="https://shorter.li/en/"/> </url> <url> <loc>https://shorter.li/login/de</loc> <lastmod>2024-12-09T15:07:58+01:00</lastmod> <changefreq>weekly</changefreq> <priority>0.1</priority> <xhtml:link rel="alternate" hreflang="de" href="https://shorter.li/login/de"/> <xhtml:link rel="alternate" hreflang="en" href="https://shorter.li/login/en"/> </url> </urlset>
robots.txt
User-agent: google
Allow: /
Allow: /de/
Allow: /en/
Allow: /public
Disallow: /admin
User-agent: bing
Allow: /
Disallow: /de/
Disallow: /en/
Disallow: /admin
User-agent: *
Disallow: /
Note
Many thanks to the creators of the PrestaSitemapBundle. From there I got many ideas and sometimes also some code...