def location_schema_html(self):
html = [
'<span itemscope itemprop="location" itemtype="http://schema.org/Place">',
' <meta itemprop="name" content="%s" />' % self.actual_city_name,
' <meta itemprop="address" content="%s" />' % self.actual_city_name,
]
if self.latitude:
html += [
' <span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">',
' <meta itemprop="latitude" content="%s" />' % self.latitude,
' <meta itemprop="longitude" content="%s" />' % self.longitude,
' </span>',
]
html += [
'</span>',
]
return jinja2.Markup('\n'.join(html))
评论列表
文章目录