This repository was archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Usage
Mario Basic edited this page Mar 31, 2015
·
12 revisions
Framework agnostic approach
use Laravelista\Bard\UrlSet as Sitemap;
use Sabre\Xml\Writer;
use Carbon\Carbon;
$sitemap = new Sitemap(new Writer);
$home = $sitemap->addUrl('http://acme.me');
$home->setPriority(0.8);
$home->setChangeFrequency('hourly');
$home->setLastModification(Carbon::now());
$home->addTranslation("de", 'http://acme.me/de/contact');*/
$sitemap->addUrl(
'http://acme.me/contact',
0.5,
null,
new DateTime('2015-04-01'),
[
[
"hreflang" => 'de',
'href' => 'http://acme.me/de/contact'
]
]
);
$sitemap->addUrl('http://acme.me/gallery');
return $sitemap->render();
use Laravelista\Bard\SitemapIndex;
use Sabre\Xml\Writer;
use Carbon\Carbon;
$sitemapIndex = new SitemapIndex(new Writer);
$sitemapIndex->addSitemap('http://acme.me/sitemap-tags.xml');
$sitemapIndex->addSitemap('http://acme.me/sitemap-people.xml', Carbon::now());
$sitemapIndex->addSitemap('http://acme.me/sitemap-comments.xml', new DateTime('2015-04-01'));
return $sitemapIndex->render();
- The cool image with Bard flying and Bard logo are from Bard, the Wandering Caretaker revealed website.