Skip to content

Commit

Permalink
make generated links absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Sep 17, 2018
1 parent ad9e6f6 commit 7ba7c36
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-sitemap` will be documented in this file

## 5.2.4 - 2018-09-17

- Make all generated links absolute

## 5.2.3 - 2018-08-28

- Add support for Laravel 5.7
Expand Down
5 changes: 3 additions & 2 deletions resources/views/url.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<url>
@if (! empty($tag->url))
<loc>{{ $tag->url }}</loc>

<loc>{{ url($tag->url) }}</loc>
@endif
@if (count($tag->alternates))
@foreach ($tag->alternates as $alternate)
<xhtml:link rel="alternate" hreflang="{{ $alternate->locale }}" href="{{ $alternate->url }}" />
<xhtml:link rel="alternate" hreflang="{{ $alternate->locale }}" href="{{ url($alternate->url) }}" />
@endforeach
@endif
@if (! empty($tag->lastModificationDate))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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">
<url>
<loc>/home</loc>
<loc>http://localhost/home</loc>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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">
<url>
<loc>/home</loc>
<loc>http://localhost/home</loc>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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">
<url>
<loc>/home</loc>
<loc>http://localhost/home</loc>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?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">
<url>
<loc>/home</loc>
<xhtml:link rel="alternate" hreflang="nl" href="/thuis"/>
<xhtml:link rel="alternate" hreflang="fr" href="/maison"/>
<loc>http://localhost/home</loc>
<xhtml:link rel="alternate" hreflang="nl" href="http://localhost/thuis"/>
<xhtml:link rel="alternate" hreflang="fr" href="http://localhost/maison"/>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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">
<url>
<loc>/home</loc>
<loc>http://localhost/home</loc>
<lastmod>2015-12-31T00:00:00+00:00</lastmod>
<changefreq>yearly</changefreq>
<priority>0.1</priority>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?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">
<url>
<loc>/contact</loc>
<loc>http://localhost/contact</loc>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>/home</loc>
<loc>http://localhost/home</loc>
<lastmod>2016-01-01T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
Expand Down

0 comments on commit 7ba7c36

Please sign in to comment.