neuer versuch
This commit is contained in:
1725
src/lib/blog-data.ts
Normal file
1725
src/lib/blog-data.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -13,3 +13,30 @@ export function generateFaqSchema(questions: Record<string, { question: string;
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function generateSoftwareAppSchema(
|
||||
name: string,
|
||||
description: string,
|
||||
imagePath: string,
|
||||
applicationCategory: string = 'UtilitiesApplication'
|
||||
) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'SoftwareApplication',
|
||||
name,
|
||||
applicationCategory,
|
||||
operatingSystem: 'Web Browser',
|
||||
image: `https://www.qrmaster.net${imagePath}`,
|
||||
offers: {
|
||||
'@type': 'Offer',
|
||||
price: '0',
|
||||
priceCurrency: 'USD',
|
||||
},
|
||||
aggregateRating: {
|
||||
'@type': 'AggregateRating',
|
||||
ratingValue: '4.8',
|
||||
ratingCount: '1250',
|
||||
},
|
||||
description,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,21 +40,28 @@ export interface HowToTask {
|
||||
totalTime?: string;
|
||||
}
|
||||
|
||||
const BASE_URL = 'https://www.qrmaster.net';
|
||||
|
||||
function toAbsoluteUrl(path: string): string {
|
||||
if (path.startsWith('http')) return path;
|
||||
return `${BASE_URL}${path.startsWith('/') ? '' : '/'}${path}`;
|
||||
}
|
||||
|
||||
export function organizationSchema() {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'Organization',
|
||||
'@id': 'https://www.qrmaster.net/#organization',
|
||||
'@id': `${BASE_URL}/#organization`,
|
||||
name: 'QR Master',
|
||||
alternateName: 'QRMaster',
|
||||
url: 'https://www.qrmaster.net',
|
||||
url: BASE_URL,
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
url: 'https://www.qrmaster.net/static/og-image.png',
|
||||
url: `${BASE_URL}/og-image.png`,
|
||||
width: 1200,
|
||||
height: 630,
|
||||
},
|
||||
image: 'https://www.qrmaster.net/static/og-image.png',
|
||||
image: `${BASE_URL}/og-image.png`,
|
||||
sameAs: [
|
||||
'https://twitter.com/qrmaster',
|
||||
],
|
||||
@@ -68,8 +75,6 @@ export function organizationSchema() {
|
||||
slogan: 'Dynamic QR codes that work smarter',
|
||||
foundingDate: '2025',
|
||||
areaServed: 'Worldwide',
|
||||
serviceType: 'Software as a Service',
|
||||
priceRange: '$0 - $29',
|
||||
knowsAbout: [
|
||||
'QR Code Generation',
|
||||
'Marketing Analytics',
|
||||
@@ -121,8 +126,7 @@ export function organizationSchema() {
|
||||
},
|
||||
],
|
||||
},
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: 'https://www.qrmaster.net',
|
||||
mainEntityOfPage: BASE_URL,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -130,19 +134,19 @@ export function websiteSchema() {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'WebSite',
|
||||
'@id': 'https://www.qrmaster.net/#website',
|
||||
'@id': `${BASE_URL}/#website`,
|
||||
name: 'QR Master',
|
||||
url: 'https://www.qrmaster.net',
|
||||
url: BASE_URL,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: 'https://www.qrmaster.net',
|
||||
mainEntityOfPage: BASE_URL,
|
||||
publisher: {
|
||||
'@id': 'https://www.qrmaster.net/#organization',
|
||||
'@id': `${BASE_URL}/#organization`,
|
||||
},
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: {
|
||||
'@type': 'EntryPoint',
|
||||
urlTemplate: 'https://www.qrmaster.net/blog?q={search_term_string}',
|
||||
urlTemplate: `${BASE_URL}/blog?q={search_term_string}`,
|
||||
},
|
||||
'query-input': 'required name=search_term_string',
|
||||
},
|
||||
@@ -153,14 +157,14 @@ export function breadcrumbSchema(items: BreadcrumbItem[]) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'BreadcrumbList',
|
||||
'@id': `https://www.qrmaster.net${items[items.length - 1]?.url}#breadcrumb`,
|
||||
'@id': `${BASE_URL}${items[items.length - 1]?.url}#breadcrumb`,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: `https://www.qrmaster.net${items[items.length - 1]?.url}`,
|
||||
mainEntityOfPage: `${BASE_URL}${items[items.length - 1]?.url}`,
|
||||
itemListElement: items.map((item, index) => ({
|
||||
'@type': 'ListItem',
|
||||
position: index + 1,
|
||||
name: item.name,
|
||||
item: `https://www.qrmaster.net${item.url}`,
|
||||
item: toAbsoluteUrl(item.url),
|
||||
})),
|
||||
};
|
||||
}
|
||||
@@ -169,14 +173,14 @@ export function blogPostingSchema(post: BlogPost) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'BlogPosting',
|
||||
'@id': `https://www.qrmaster.net/blog/${post.slug}#article`,
|
||||
'@id': `${BASE_URL}/blog/${post.slug}#article`,
|
||||
headline: post.title,
|
||||
description: post.description,
|
||||
image: post.image,
|
||||
image: toAbsoluteUrl(post.image),
|
||||
datePublished: post.datePublished,
|
||||
dateModified: post.dateModified,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: `https://www.qrmaster.net/blog/${post.slug}`,
|
||||
mainEntityOfPage: `${BASE_URL}/blog/${post.slug}`,
|
||||
author: {
|
||||
'@type': 'Person',
|
||||
name: post.author,
|
||||
@@ -185,19 +189,19 @@ export function blogPostingSchema(post: BlogPost) {
|
||||
publisher: {
|
||||
'@type': 'Organization',
|
||||
name: 'QR Master',
|
||||
url: 'https://www.qrmaster.net',
|
||||
url: BASE_URL,
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
url: 'https://www.qrmaster.net/static/og-image.png',
|
||||
url: `${BASE_URL}/og-image.png`,
|
||||
width: 1200,
|
||||
height: 630,
|
||||
},
|
||||
},
|
||||
isPartOf: {
|
||||
'@type': 'Blog',
|
||||
'@id': 'https://www.qrmaster.net/blog#blog',
|
||||
'@id': `${BASE_URL}/blog#blog`,
|
||||
name: 'QR Master Blog',
|
||||
url: 'https://www.qrmaster.net/blog',
|
||||
url: `${BASE_URL}/blog`,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -206,9 +210,9 @@ export function faqPageSchema(faqs: FAQItem[]) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'FAQPage',
|
||||
'@id': 'https://www.qrmaster.net/faq#faqpage',
|
||||
'@id': `${BASE_URL}/faq#faqpage`,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: 'https://www.qrmaster.net/faq',
|
||||
mainEntityOfPage: `${BASE_URL}/faq`,
|
||||
mainEntity: faqs.map((faq) => ({
|
||||
'@type': 'Question',
|
||||
name: faq.question,
|
||||
@@ -224,11 +228,11 @@ export function productSchema(product: { name: string; description: string; offe
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'Product',
|
||||
'@id': 'https://www.qrmaster.net/pricing#product',
|
||||
'@id': `${BASE_URL}/pricing#product`,
|
||||
name: product.name,
|
||||
description: product.description,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: 'https://www.qrmaster.net/pricing',
|
||||
mainEntityOfPage: `${BASE_URL}/pricing`,
|
||||
brand: {
|
||||
'@type': 'Organization',
|
||||
name: 'QR Master',
|
||||
@@ -239,7 +243,7 @@ export function productSchema(product: { name: string; description: string; offe
|
||||
price: offer.price,
|
||||
priceCurrency: offer.priceCurrency,
|
||||
availability: offer.availability,
|
||||
url: offer.url,
|
||||
url: toAbsoluteUrl(offer.url),
|
||||
})),
|
||||
};
|
||||
}
|
||||
@@ -248,18 +252,18 @@ export function howToSchema(task: HowToTask) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'HowTo',
|
||||
'@id': `https://www.qrmaster.net/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}#howto`,
|
||||
'@id': `${BASE_URL}/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}#howto`,
|
||||
name: task.name,
|
||||
description: task.description,
|
||||
inLanguage: 'en',
|
||||
mainEntityOfPage: `https://www.qrmaster.net/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}`,
|
||||
mainEntityOfPage: `${BASE_URL}/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}`,
|
||||
totalTime: task.totalTime || 'PT5M',
|
||||
step: task.steps.map((step, index) => ({
|
||||
'@type': 'HowToStep',
|
||||
position: index + 1,
|
||||
name: step.name,
|
||||
text: step.text,
|
||||
url: step.url,
|
||||
url: step.url ? toAbsoluteUrl(step.url) : undefined,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user