|
| 1 | +import { tracks, type Track } from "../data/tracks"; |
| 2 | +import { |
| 3 | + DEFAULT_DESCRIPTION, |
| 4 | + SITE_NAME, |
| 5 | + SITE_TAGLINE, |
| 6 | + SITE_URL, |
| 7 | + absoluteUrl, |
| 8 | + getExamPrepPath |
| 9 | +} from "./site"; |
| 10 | + |
| 11 | +function organizationNode() { |
| 12 | + return { |
| 13 | + "@type": "Organization", |
| 14 | + "@id": `${SITE_URL}#organization`, |
| 15 | + name: SITE_NAME, |
| 16 | + url: SITE_URL, |
| 17 | + logo: absoluteUrl("/certprep-logo.svg"), |
| 18 | + sameAs: ["https://github.com/certforge"], |
| 19 | + description: DEFAULT_DESCRIPTION |
| 20 | + }; |
| 21 | +} |
| 22 | + |
| 23 | +function websiteNode() { |
| 24 | + return { |
| 25 | + "@type": "WebSite", |
| 26 | + "@id": `${SITE_URL}#website`, |
| 27 | + name: SITE_NAME, |
| 28 | + url: SITE_URL, |
| 29 | + description: DEFAULT_DESCRIPTION, |
| 30 | + publisher: { "@id": `${SITE_URL}#organization` }, |
| 31 | + inLanguage: "en" |
| 32 | + }; |
| 33 | +} |
| 34 | + |
| 35 | +export function homeStructuredData() { |
| 36 | + return { |
| 37 | + "@context": "https://schema.org", |
| 38 | + "@graph": [ |
| 39 | + organizationNode(), |
| 40 | + websiteNode(), |
| 41 | + { |
| 42 | + "@type": "CollectionPage", |
| 43 | + "@id": `${SITE_URL}#home`, |
| 44 | + name: `${SITE_NAME} certification prep hub`, |
| 45 | + url: SITE_URL, |
| 46 | + description: DEFAULT_DESCRIPTION, |
| 47 | + isPartOf: { "@id": `${SITE_URL}#website` }, |
| 48 | + about: tracks.map((track) => `${track.examCode}: ${track.title}`), |
| 49 | + mainEntity: { |
| 50 | + "@type": "ItemList", |
| 51 | + itemListElement: tracks.map((track, index) => ({ |
| 52 | + "@type": "ListItem", |
| 53 | + position: index + 1, |
| 54 | + url: absoluteUrl(getExamPrepPath(track.id)), |
| 55 | + name: `${track.examCode}: ${track.title}` |
| 56 | + })) |
| 57 | + } |
| 58 | + }, |
| 59 | + { |
| 60 | + "@type": "FAQPage", |
| 61 | + "@id": `${SITE_URL}#faq`, |
| 62 | + mainEntity: [ |
| 63 | + { |
| 64 | + "@type": "Question", |
| 65 | + name: "How should I use CertPrep to study for an exam?", |
| 66 | + acceptedAnswer: { |
| 67 | + "@type": "Answer", |
| 68 | + text: "Start with the exam blueprint page, follow the weighted domain guides, run the matching demos or scripts, and then review using mock exams or quick-reference notes." |
| 69 | + } |
| 70 | + }, |
| 71 | + { |
| 72 | + "@type": "Question", |
| 73 | + name: "Does CertPrep include hands-on labs and mock exams?", |
| 74 | + acceptedAnswer: { |
| 75 | + "@type": "Answer", |
| 76 | + text: "Yes. Tracks include runnable demos, scripts, quick references, and where available mock exams or practice-question sets inside the linked repositories." |
| 77 | + } |
| 78 | + }, |
| 79 | + { |
| 80 | + "@type": "Question", |
| 81 | + name: "Which certification tracks are currently available?", |
| 82 | + acceptedAnswer: { |
| 83 | + "@type": "Answer", |
| 84 | + text: tracks.map((track) => `${track.examCode}: ${track.title}`).join("; ") |
| 85 | + } |
| 86 | + } |
| 87 | + ] |
| 88 | + } |
| 89 | + ] |
| 90 | + }; |
| 91 | +} |
| 92 | + |
| 93 | +export function examPrepIndexStructuredData() { |
| 94 | + return { |
| 95 | + "@context": "https://schema.org", |
| 96 | + "@graph": [ |
| 97 | + organizationNode(), |
| 98 | + websiteNode(), |
| 99 | + { |
| 100 | + "@type": "CollectionPage", |
| 101 | + name: `${SITE_NAME} exam blueprints`, |
| 102 | + url: absoluteUrl("/exam-prep"), |
| 103 | + description: |
| 104 | + "Certification exam blueprint pages covering domain weights, focus areas, and direct links into each CertPrep repository.", |
| 105 | + isPartOf: { "@id": `${SITE_URL}#website` }, |
| 106 | + mainEntity: { |
| 107 | + "@type": "ItemList", |
| 108 | + itemListElement: tracks.map((track, index) => ({ |
| 109 | + "@type": "ListItem", |
| 110 | + position: index + 1, |
| 111 | + url: absoluteUrl(getExamPrepPath(track.id)), |
| 112 | + name: `${track.examCode}: ${track.title}` |
| 113 | + })) |
| 114 | + } |
| 115 | + } |
| 116 | + ] |
| 117 | + }; |
| 118 | +} |
| 119 | + |
| 120 | +export function examTrackStructuredData(track: Track) { |
| 121 | + return { |
| 122 | + "@context": "https://schema.org", |
| 123 | + "@graph": [ |
| 124 | + organizationNode(), |
| 125 | + websiteNode(), |
| 126 | + { |
| 127 | + "@type": "LearningResource", |
| 128 | + name: `${track.examCode}: ${track.title} exam blueprint`, |
| 129 | + url: absoluteUrl(getExamPrepPath(track.id)), |
| 130 | + description: track.summary, |
| 131 | + isPartOf: { "@id": `${SITE_URL}#website` }, |
| 132 | + publisher: { "@id": `${SITE_URL}#organization` }, |
| 133 | + learningResourceType: "Certification exam blueprint", |
| 134 | + educationalLevel: "Professional certification", |
| 135 | + about: track.domains.map((domain) => ({ |
| 136 | + "@type": "DefinedTerm", |
| 137 | + name: domain.name, |
| 138 | + description: domain.focus.join(", ") |
| 139 | + })), |
| 140 | + teaches: track.highlights, |
| 141 | + keywords: [track.examCode, track.title, SITE_NAME, SITE_TAGLINE] |
| 142 | + }, |
| 143 | + { |
| 144 | + "@type": "BreadcrumbList", |
| 145 | + itemListElement: [ |
| 146 | + { |
| 147 | + "@type": "ListItem", |
| 148 | + position: 1, |
| 149 | + name: SITE_NAME, |
| 150 | + item: SITE_URL |
| 151 | + }, |
| 152 | + { |
| 153 | + "@type": "ListItem", |
| 154 | + position: 2, |
| 155 | + name: "Exam Prep Help", |
| 156 | + item: absoluteUrl("/exam-prep") |
| 157 | + }, |
| 158 | + { |
| 159 | + "@type": "ListItem", |
| 160 | + position: 3, |
| 161 | + name: `${track.examCode}: ${track.title}`, |
| 162 | + item: absoluteUrl(getExamPrepPath(track.id)) |
| 163 | + } |
| 164 | + ] |
| 165 | + } |
| 166 | + ] |
| 167 | + }; |
| 168 | +} |
0 commit comments