Created
September 5, 2022 18:03
-
-
Save atakde/59dcd24f45bfd4ddf1d2171d673c55f5 to your computer and use it in GitHub Desktop.
Symfony 6 Sitemap Twig Template
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" | |
| xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" 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"> | |
| {% for url in urls %} | |
| <url>{# check if hostname is not alreay in url#} | |
| <loc>{{ url.loc }}</loc> | |
| {% if url.lastmod is defined %} | |
| <lastmod>{{url.lastmod}}</lastmod> | |
| {% endif %} | |
| {% if url.changefreq is defined %} | |
| <changefreq>{{url.changefreq}}</changefreq> | |
| {% endif %} | |
| {% if url.priority is defined %} | |
| <priority>{{url.priority}}</priority> | |
| {% endif %} | |
| </url> | |
| {% endfor %} | |
| </urlset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment