1. Go to this page and download the library: Download vulpo/seo-and-geo library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Vulpo\Seo\Facades\Seo;
use Vulpo\Seo\Schema\Nodes\{ProductNode, OfferNode};
Seo::override([
'title' => $product->name,
'description' => $product->excerpt,
'canonical' => route('shop.product', $product->slug),
'image' => $product->cover,
'og_type' => 'product',
'noindex' => $product->hidden,
])
->breadcrumbs([
['name' => 'Badkamer', 'url' => '/badkamer'],
['name' => $product->name], // the last crumb is the page you are on
])
->schema(
ProductNode::make($product->name)
->gtin($product->ean)
->brand($product->brand)
->image($product->images)
->condition('new')
->offer(OfferNode::fromMinorUnits($product->priceCents)->availability('in_stock')),
);
use Vulpo\Seo\Contracts\SitemapProvider;
use Vulpo\Seo\Sitemap\SitemapUrl;
class ProductSitemapProvider implements SitemapProvider
{
public function sitemapUrls(string $site): iterable
{
foreach ($this->products->cursor() as $product) {
yield SitemapUrl::make(route('shop.product', $product->slug))
->lastmod($product->updatedAt)
->image($product->cover);
}
}
}
// In your service provider's boot():
Seo::sitemap()->register(ProductSitemapProvider::class);
Seo::llms()->register(ProductLlmsProvider::class);
blade
{!! Statamic::tag('vulpo_seo') !!}
bash
php please vulpo:seo:migrate --dry-run # see what would change
php please vulpo:seo:migrate