warmseal-roofing/meta/schema.php
Mark ebc25857dc Add minified JavaScript and CSS files, implement datepicker and carousel functionality
- Added minified versions of JavaScript files including main, script, google-map, bootstrap-datepicker, and jquery.easing.
- Implemented a datepicker for appointment dates and a timepicker for appointment times.
- Introduced a carousel feature for image display with automatic sliding and responsive behavior.
- Updated package.json to include scripts for minifying CSS and JS files, along with necessary dependencies.
2025-06-30 10:13:47 +01:00

209 lines
8.1 KiB
PHP

<?php
// Page-specific Schema.org structured data
function generatePageSchema($page, $URLcorrection = "")
{
$baseSchema = [
"@context" => "https://schema.org",
"@type" => "WebPage",
"url" => "https://warmseal-roofing.co.uk" . ($page !== 'index' ? '/' . $page : ''),
"publisher" => [
"@type" => "Organization",
"name" => "Warmseal Roofing",
"url" => "https://warmseal-roofing.co.uk"
]
];
// Add page-specific schema based on current page
switch ($page) {
case 'roof-repairs':
$serviceSchema = [
"@context" => "https://schema.org",
"@type" => "Service",
"name" => "Emergency Roof Repairs Accrington",
"description" => "Fast, reliable emergency roof repair services in Accrington and Lancashire. Expert leak repairs, storm damage restoration, and urgent roofing solutions.",
"provider" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing"
],
"areaServed" => [
"Accrington",
"Blackburn",
"Preston",
"Lancashire"
],
"availableChannel" => [
"@type" => "ServiceChannel",
"serviceUrl" => "https://warmseal-roofing.co.uk/roof-repairs",
"availableLanguage" => "en"
]
];
return json_encode([$baseSchema, $serviceSchema], JSON_UNESCAPED_SLASHES);
break;
case 'roofing-solutions':
$serviceSchema = [
"@context" => "https://schema.org",
"@type" => "Service",
"name" => "New Roof Installation Accrington",
"description" => "Complete new roof installations and roofing solutions in Accrington. Slate, tile, and flat roofing with professional installation.",
"provider" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing"
],
"areaServed" => [
"Accrington",
"Blackburn",
"Preston",
"Lancashire"
],
"availableChannel" => [
"@type" => "ServiceChannel",
"serviceUrl" => "https://warmseal-roofing.co.uk/roofing-solutions",
"availableLanguage" => "en"
]
];
return json_encode([$baseSchema, $serviceSchema], JSON_UNESCAPED_SLASHES);
break;
case 'roofline-services':
$serviceSchema = [
"@context" => "https://schema.org",
"@type" => "Service",
"name" => "UPVC Roofline Services Accrington",
"description" => "Professional UPVC roofline services including guttering, fascias, soffits, and roofline maintenance in Accrington and Lancashire.",
"provider" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing"
],
"areaServed" => [
"Accrington",
"Blackburn",
"Preston",
"Lancashire"
],
"availableChannel" => [
"@type" => "ServiceChannel",
"serviceUrl" => "https://warmseal-roofing.co.uk/roofline-services",
"availableLanguage" => "en"
]
];
return json_encode([$baseSchema, $serviceSchema], JSON_UNESCAPED_SLASHES);
break;
case 'cleaning':
$serviceSchema = [
"@context" => "https://schema.org",
"@type" => "Service",
"name" => "Roof Cleaning & Moss Removal Accrington",
"description" => "Professional roof cleaning, moss removal, and gutter cleaning services in Accrington and Lancashire. Safe, effective cleaning solutions.",
"provider" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing"
],
"areaServed" => [
"Accrington",
"Blackburn",
"Preston",
"Lancashire"
],
"availableChannel" => [
"@type" => "ServiceChannel",
"serviceUrl" => "https://warmseal-roofing.co.uk/cleaning",
"availableLanguage" => "en"
]
];
return json_encode([$baseSchema, $serviceSchema], JSON_UNESCAPED_SLASHES);
break;
case 'projects':
$portfolioSchema = [
"@context" => "https://schema.org",
"@type" => "CreativeWork",
"name" => "Warmseal Roofing Portfolio",
"description" => "View our completed roofing projects in Accrington and Lancashire. Examples of our professional roofing work.",
"creator" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing"
],
"about" => "Roofing Projects and Portfolio",
"locationCreated" => [
"Accrington",
"Blackburn",
"Preston",
"Lancashire"
]
];
return json_encode([$baseSchema, $portfolioSchema], JSON_UNESCAPED_SLASHES);
break;
case 'contact':
$contactSchema = [
"@context" => "https://schema.org",
"@type" => "ContactPage",
"name" => "Contact Warmseal Roofing",
"description" => "Contact Warmseal Roofing for a free quote. Professional roofer in Accrington serving Lancashire.",
"mainEntity" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing",
"telephone" => "+44-1254-123456",
"email" => "info@warmseal-roofing.co.uk"
]
];
return json_encode([$baseSchema, $contactSchema], JSON_UNESCAPED_SLASHES);
break;
case 'about-us':
$aboutSchema = [
"@context" => "https://schema.org",
"@type" => "AboutPage",
"name" => "About Warmseal Roofing",
"description" => "Learn about Warmseal Roofing, your trusted local roofer in Accrington with years of experience serving Lancashire.",
"mainEntity" => [
"@type" => "RoofingContractor",
"name" => "Warmseal Roofing",
"foundingDate" => "2020",
"address" => [
"@type" => "PostalAddress",
"addressLocality" => "Accrington",
"addressRegion" => "Lancashire",
"addressCountry" => "GB"
]
]
];
return json_encode([$baseSchema, $aboutSchema], JSON_UNESCAPED_SLASHES);
break;
default:
return json_encode($baseSchema, JSON_UNESCAPED_SLASHES);
}
}
// Generate breadcrumb schema
function generateBreadcrumbSchema($page, $pageTitle)
{
$breadcrumbs = [
"@context" => "https://schema.org",
"@type" => "BreadcrumbList",
"itemListElement" => [
[
"@type" => "ListItem",
"position" => 1,
"name" => "Home",
"item" => "https://warmseal-roofing.co.uk"
]
]
];
if ($page !== 'index' && $page !== '') {
$breadcrumbs["itemListElement"][] = [
"@type" => "ListItem",
"position" => 2,
"name" => $pageTitle,
"item" => "https://warmseal-roofing.co.uk/" . $page
];
}
return json_encode($breadcrumbs, JSON_UNESCAPED_SLASHES);
}