Files
tripwithbonus/BaseModels/search_optimization/ld_json/ld_ speakebale.py
SDE b2bd830b6e 0.0.3
GeneralApp add
2023-06-19 17:19:18 +03:00

38 lines
966 B
Python

def get_ld_speakebale(name, theme_xpath, info_xpath, url):
data = {
"@context": "https://schema.org/",
"@type": "WebPage",
"name": name,
"speakable": {
"@type": "SpeakableSpecification",
"xPath": [
theme_xpath,
info_xpath
]
},
"url": url
}
return data
# <title>Speakable markup example</title>
# <meta name="description" content="This page is all about the quick brown fox" />
# <script type="application/ld+json">
# {
# "@context": "https://schema.org/",
# "@type": "WebPage",
# "name": "Quick Brown Fox",
# "speakable":
# {
# "@type": "SpeakableSpecification",
# "xPath": [
# "/html/head/title",
# "/html/head/meta[@name='description']/@content"
# ]
# },
# "url": "http://www.quickbrownfox_example.com/quick-brown-fox"
# }
# </script>