New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core -> Webfiles and Metatags: Schema.org tags #122
Comments
@bcardarella this will be part of version 0.1.0. Please correct me if I'm wrong |
@AZholtkevych this is necessary for dockyard.com launch. I think this lib can help: https://github.com/rdf-elixir/jsonld-ex |
Search engines parse structured data to better understand each page in order to categorize a site and display rich results. There are different ways to add such data to pages and we'll use JSON-LD that is recommended by Google. Working with structured data will be split into 2 parts:
This issue covers the first part only. See BeaconCMS/beacon_live_admin#36 for part 2. Data Structure and StorageLet's keep it as simple as possible. We'll add a Given this ld-json schema: [{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "Banana Bread Recipe",
"description": "The best banana bread recipe you'll ever find! Learn how to use up all those extra bananas."
},
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Recipes",
"item": "https://example.com/recipes"
},{
"@type": "ListItem",
"position": 2,
"name": "Bread recipes",
"item": "https://example.com/recipes/bread-recipes"
},{
"@type": "ListItem",
"position": 3,
"name": "How To Make Banana Bread"
}]
}] In Elixir it will look like: [
%{
"@context" => "https://schema.org/",
"@type" => "Recipe",
"name" => "Banana Bread Recipe"
# ... omitted for brevity
},
%{
"@context" => "https://schema.org",
"@type" => "BreadcrumbList",
"itemListElement" => [
%{
"@type" => "ListItem",
"item" => "https://example.com/recipes",
"name" => "Recipes",
"position" => 1
}
# ... omitted for brevity
]
}
] And rendered inside <script type="application/ld+json">
[{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "Banana Bread Recipe",
"description": "The best banana bread recipe you'll ever find! Learn how to use up all those extra bananas."
},
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Recipes",
"item": "https://example.com/recipes"
},{
"@type": "ListItem",
"position": 2,
"name": "Bread recipes",
"item": "https://example.com/recipes/bread-recipes"
},{
"@type": "ListItem",
"position": 3,
"name": "How To Make Banana Bread"
}]
}]
</script> So it'll be stored as the original json without transformations, which is simple and flexible to support individual or nested multiple items. RenderingIt should be similar to rendering meta tags but without the Notes
Refs
|
See #122 (comment) for implementation details.
In addition to the meta tag support we should be using schema.org tags for better SEO. Here is what dockyard.com is currently rendering:
Verifier: https://validator.schema.org/#url=https%3A%2F%2Fdockyard.com%2Fblog%2F2023%2F01%2F17%2Fliveview-native-yearly-update
The text was updated successfully, but these errors were encountered: