Schema.org, top snippets for your portfolio or blog with spatie/schema-org
Last active
June 16, 2024 11:51
-
-
Save abenevaut/39bb1bf0a4aef3334b13b74f28183820 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$blogPost = Schema::blogPosting() | |
->headline('Titre de l\'article') | |
->datePublished('2023-06-01') | |
->author($author) | |
->articleBody('Contenu de l\'article...') | |
->image('http://www.example.com/images/article-image.jpg') | |
->publisher($organization); | |
$blog = Schema::blog() | |
->name('Le Blog de John Doe') | |
->blogPost($blogPost); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$comment = Schema::comment() | |
->author(Schema::person()->name('Jane Doe')) | |
->datePublished('2023-06-02') | |
->text('Ceci est un commentaire sur l\'article.'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$event = Schema::event() | |
->name('Conférence sur le Développement Web') | |
->startDate('2023-09-01T09:00') | |
->endDate('2023-09-01T17:00') | |
->location(Schema::place()->name('Centre des Congrès')->address('123 Rue Exemple, Paris, France')) | |
->organizer($author); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$imageObject = Schema::imageObject() | |
->contentUrl('http://www.example.com/images/photo.jpg') | |
->creator($author) | |
->datePublished('2023-06-01') | |
->description('Une photo de démonstration'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$localBusiness = Schema::localBusiness() | |
->name('Tech Solutions Inc.') | |
->address( | |
Schema::postalAddress() | |
->streetAddress('123 Rue Exemple') | |
->addressLocality('Paris') | |
->postalCode('75000') | |
->addressCountry('France') | |
) | |
->telephone('+33-1-23-45-67-89') | |
->url('http://www.techsolutions.com'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$organization = Schema::organization() | |
->name('Tech Solutions Inc.') | |
->url('http://www.techsolutions.com') | |
->sameAs([ | |
'http://www.facebook.com/techsolutions', | |
'http://www.twitter.com/techsolutions', | |
'http://www.linkedin.com/company/techsolutions' | |
]); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$portfolioProject = Schema::creativeWork() | |
->name('Projet de Développement Web') | |
->creator($author) | |
->datePublished('2023-05-01') | |
->description('Description du projet...'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$product = Schema::product() | |
->name('Produit Exemple') | |
->description('Description du produit exemple.') | |
->image('http://www.example.com/images/product.jpg') | |
->sku('12345') | |
->offers( | |
Schema::offer() | |
->price(29.99) | |
->priceCurrency('EUR') | |
->availability('http://schema.org/InStock') | |
); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$service = Schema::service() | |
->name('Développement Web') | |
->description('Service de développement web complet') | |
->provider($author) | |
->areaServed(Schema::place()->name('France')) | |
->serviceType('Développement de site web'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$termsOfService = Schema::termsOfService() | |
->name('Conditions Générales d\'Utilisation') | |
->datePublished('2023-06-01') | |
->mainEntityOfPage('Contenu des termes de service...'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$videoObject = Schema::videoObject() | |
->name('Titre de la vidéo') | |
->description('Description de la vidéo') | |
->thumbnailUrl('http://www.example.com/images/video-thumbnail.jpg') | |
->uploadDate('2023-06-01') | |
->contentUrl('http://www.example.com/videos/video.mp4'); |
This file contains 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
<?php | |
use Spatie\SchemaOrg\Schema; | |
$webPage = Schema::webPage() | |
->name('Accueil') | |
->description('Page d\'accueil de John Doe') | |
->url('http://www.johndoe.com') | |
->author($author); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment