Structured Data
Structured data helps search engines understand the content of your page and display it in rich results (like FAQ snippets or Organization knowledge panels). FiNAN uses JSON-LD (JavaScript Object Notation for Linked Data) for this purpose.
JSON-LD Implementation
Section titled “JSON-LD Implementation”In Astro, structured data is best added using a standard <script type="application/ld+json"> tag within the page <head> or body.
Helper Component
Section titled “Helper Component”We use a helper pattern to inject schemas safely. You can pass a schema object to a StructuredData component or directly into the layout.
---// Example usage in a pageimport { Schema } from 'astro-seo-schema';---
<Schema item={{ "@context": "https://schema.org", "@type": "Organization", "name": "FiNAN", "url": "https://finan.eu", "logo": "https://finan.eu/logo.png" }}/>Note: If you are using a specific library or helper function, ensure it serializes the JSON correctly and handles escaping.
Organization Schema
Section titled “Organization Schema”The Organization schema is included on the homepage and critical landing pages to establish FiNAN’s identity.
Fields to Include:
name: “FiNAN”url: The website URLlogo: Path to the official logosameAs: Array of social media profile links (Twitter/X, LinkedIn, etc.)
Example:
{ "@context": "https://schema.org", "@type": "Organization", "name": "FiNAN", "alternateName": "Finnish Alumni Network of North America", "url": "https://finan.eu", "logo": "https://finan.eu/logo.png", "sameAs": [ "https://twitter.com/finan_eu", "https://www.linkedin.com/company/finan-eu" ]}FAQ Schema
Section titled “FAQ Schema”For pages with an accordion-style FAQ section (like the main FAQ page or support pages), implementing FAQPage schema is highly recommended to get rich snippets in search results.
Automated FAQ Schema
Section titled “Automated FAQ Schema”If you are using the <FAQAccordion> component, check if it automatically generates schema. If not, you should manually constructing the schema from your data source.
// Example: Converting FAQ data to Schemaconst faqSchema = { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": faqData.map(item => ({ "@type": "Question", "name": item.question, "acceptedAnswer": { "@type": "Answer", "text": item.answer } }))};You can then inject this faqSchema object into the page:
<script type="application/ld+json" set:html={JSON.stringify(faqSchema)} />Validating Structured Data
Section titled “Validating Structured Data”Always validate your structured data before deploying.
- Open the Google Rich Results Test.
- Paste your code snippet or the URL of the deployed page.
- Check for errors or warnings.