应使用 https://schema.org/WeatherForecast;必须搭配 itemscope,且每个预报日需独立包裹;必备属性为 weatherCode、forecastDate(ISO 8601 格式)和 temperature(含 value 与 unitCode,如 "CELS")。

用 itemtype 标记天气预报该选哪个 Schema 类型
直接用 https://schema.org/WeatherForecast。这是唯一被 Google、Bing 和结构化数据测试工具广泛识别的天气类型,其他如 Climate 或自定义类型基本不被解析。
注意:必须搭配 Google 的富媒体搜索结果(如天气卡片)要求至少提供以下三项,缺一不可: 漏掉 避免把 用 Google 的 Rich Results Test 工具检测后,高频错误有: 多日预报要为每一天建独立的 itemscope 使用,且整个天气块要是一个独立的语义单元(比如一个 itemtype。WeatherForecast 必须包含哪些属性才被有效识别
weatherCode(或 weatherCondition)——建议用 weatherCode,值为 https://schema.org/WeatherCode 枚举值(如 "sunny"、"cloudy")forecastDate —— ISO 8601 格式日期,例如 "2024-06-15",不能是相对时间(如“今天”)temperature —— 必须嵌套 value 和 unitCode,例如:<meta itemprop="value" content="26"><meta itemprop="unitCode" content="CELS">
unitCode 是最常见失败原因;用 "C" 或 "°C" 会直接导致解析失败。HTML 中怎么嵌套
itemprop 才不破坏页面样式itemprop 塞进看不见的 里——虽然合法,但会让维护者无法直观对应数据和 UI。推荐混合写法:
itemprop="forecastDate" 或 itemprop="weatherCode"
包裹整个值,再在内部用 拆出 value 和 unitCode
itemprop(比如既标 temperature 又标 value),Schema 解析器会混淆验证时常见报错和对应修复
"Missing field 'temperature'" → 检查是否漏了 itemprop="temperature" 容器,或容器内没嵌 QuantitativeValue 结构"Invalid unitCode: 'C'" → 改成 "CELS"(摄氏)或 "FAHR"(华氏),大小写敏感"forecastDate must be a date in ISO 8601 format" → 确保是 2024-06-15,不是 15/06/2024 或带时间的 2024-06-15T12:00(除非明确需要小时级预报)itemscope itemtype="https://schema.org/WeatherForecast" 块,共用一个父 itemtype 不生效。
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!











