|
120 | 120 | } -%} |
121 | 121 | <script type="application/ld+json">{{ breadcrumb_schema | tojson }}</script> |
122 | 122 | {# /Breadcrumbs schema.org #} |
| 123 | + |
| 124 | + {# Course schema.org (JSON-LD) - only on homepage #} |
| 125 | + {%- if page.is_homepage -%} |
| 126 | + {%- set course_name = config.site_name -%} |
| 127 | + {%- if config.extra and config.extra.seo and config.extra.seo.course and config.extra.seo.course.name and config.extra.seo.course.name.get(lang) -%} |
| 128 | + {%- set course_name = config.extra.seo.course.name.get(lang) -%} |
| 129 | + {%- endif -%} |
| 130 | + |
| 131 | + {%- set provider_name = "Kirill Shvakov" -%} |
| 132 | + {%- if config.extra and config.extra.seo and config.extra.seo.course and config.extra.seo.course.provider and config.extra.seo.course.provider.name -%} |
| 133 | + {%- set provider_name = config.extra.seo.course.provider.name -%} |
| 134 | + {%- endif -%} |
| 135 | + |
| 136 | + {%- set provider_schema = { |
| 137 | + '@type': 'Person', |
| 138 | + 'name': provider_name |
| 139 | + } -%} |
| 140 | + {%- if config.extra and config.extra.seo and config.extra.seo.course and config.extra.seo.course.provider and config.extra.seo.course.provider.sameAs -%} |
| 141 | + {%- set _ = provider_schema.update({'sameAs': config.extra.seo.course.provider.sameAs}) -%} |
| 142 | + {%- endif -%} |
| 143 | + |
| 144 | + {%- set course_schema = { |
| 145 | + '@context': 'https://schema.org', |
| 146 | + '@type': 'Course', |
| 147 | + 'name': course_name, |
| 148 | + 'description': page_desc, |
| 149 | + 'provider': provider_schema, |
| 150 | + 'url': canonical, |
| 151 | + 'inLanguage': lang, |
| 152 | + 'courseMode': 'online' |
| 153 | + } -%} |
| 154 | + <script type="application/ld+json">{{ course_schema | tojson }}</script> |
| 155 | + |
| 156 | + {# WebSite schema.org (JSON-LD) - only on homepage #} |
| 157 | + {%- set website_schema = { |
| 158 | + '@context': 'https://schema.org', |
| 159 | + '@type': 'WebSite', |
| 160 | + 'name': config.site_name, |
| 161 | + 'url': home_url, |
| 162 | + 'description': page_desc, |
| 163 | + 'inLanguage': lang |
| 164 | + } -%} |
| 165 | + <script type="application/ld+json">{{ website_schema | tojson }}</script> |
| 166 | + {# /WebSite schema.org #} |
| 167 | + {%- endif -%} |
| 168 | + {# /Course schema.org #} |
| 169 | + |
| 170 | + {# Person schema.org (JSON-LD) - site-wide #} |
| 171 | + {%- set person_name = "Kirill Shvakov" -%} |
| 172 | + {%- if config.extra and config.extra.seo and config.extra.seo.person and config.extra.seo.person.name -%} |
| 173 | + {%- set person_name = config.extra.seo.person.name -%} |
| 174 | + {%- endif -%} |
| 175 | + |
| 176 | + {%- set person_schema = { |
| 177 | + '@context': 'https://schema.org', |
| 178 | + '@type': 'Person', |
| 179 | + 'name': person_name |
| 180 | + } -%} |
| 181 | + {%- if config.extra and config.extra.seo and config.extra.seo.person and config.extra.seo.person.sameAs -%} |
| 182 | + {%- set _ = person_schema.update({'sameAs': config.extra.seo.person.sameAs}) -%} |
| 183 | + {%- endif -%} |
| 184 | + <script type="application/ld+json">{{ person_schema | tojson }}</script> |
| 185 | + {# /Person schema.org #} |
123 | 186 | {# --- /SEO meta tags --- #} |
124 | 187 | {% endblock %} |
125 | 188 |
|
|
0 commit comments