File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed
Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to ` laravel-sitemappable ` will be documented in this file
44
5+ ## 1.1.0 - 2021-10-21
6+
7+ - Follow Google guidelines for localized versions of pages.
8+
59## 1.0.0 - 2021-05-17
610
711- initial release.
Original file line number Diff line number Diff line change 11{!! ' <' . ' ?xml version="1.0" encoding="UTF-8"?>' ! !}
22<urlset xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml =" http://www.w3.org/1999/xhtml" >
33 @foreach ($sitemappables as $sitemappable )
4- <url >
5- <loc >{{ $sitemappable -> urls [array_key_first ($sitemappable -> urls )] } } </loc >
6- @foreach ($sitemappable -> urls as $lang => $url )
7- <xhtml:link rel =" alternate" hreflang =" {{ $lang } }" href =" {{ $url } }" ></xhtml:link >
8- @endforeach
9- @if ($sitemappable -> updated_at )
10- <lastmod >{{ $sitemappable -> updated_at -> toIso8601String () } } </lastmod >
11- @endif
12- </url >
4+ @foreach ($sitemappable -> urls as $url )
5+ <url >
6+ <loc >{{ $url } } </loc >
7+ @if (count (array_keys ($sitemappable -> urls )) > 1 )
8+ @foreach ($sitemappable -> urls as $lang => $url )
9+ <xhtml:link rel =" alternate" hreflang =" {{ $lang } }" href =" {{ $url } }" ></xhtml:link >
10+ @endforeach
11+ @endif
12+ @if ($sitemappable -> updated_at )
13+ <lastmod >{{ $sitemappable -> updated_at -> toIso8601String () } } </lastmod >
14+ @endif
15+ </url >
16+ @endforeach
1317 @endforeach
1418</urlset >
Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ public function test_it_can_generate_an_xml_sitemap()
9292 <xhtml:link rel="alternate" hreflang="en" href="https://www.vursion.io/en/tests/test-slug-in-english"></xhtml:link>
9393 <lastmod> ' . $ testModel ->updated_at ->toIso8601String () . '</lastmod>
9494 </url>
95+ <url>
96+ <loc>https://www.vursion.io/en/tests/test-slug-in-english</loc>
97+ <xhtml:link rel="alternate" hreflang="nl" href="https://www.vursion.io/nl/testen/test-slug-in-het-nederlands"></xhtml:link>
98+ <xhtml:link rel="alternate" hreflang="en" href="https://www.vursion.io/en/tests/test-slug-in-english"></xhtml:link>
99+ <lastmod> ' . $ testModel ->updated_at ->toIso8601String () . '</lastmod>
100+ </url>
95101 </urlset> ' );
96102
97103 $ this ->assertXmlStringEqualsXmlString ($ expected , $ response ->getContent ());
You can’t perform that action at this time.
0 commit comments