1 | from .._variables import verify |
2 | import htmlgenerator as hg |
3 |
|
4 |
|
5 | def run(data): |
6 | """Build HTML meta tags and insert tracking script""" |
7 |
|
8 | verify(data, ["title", "description", "thumbnail", "link"]) |
9 |
|
10 | contents = [ |
11 | hg.META(http_equiv="content-type", content="text/html; charset=utf-8"), |
12 | hg.META(name="format-detection", content="telephone=no,date=no,address=no,email=no,url=no"), |
13 | hg.TITLE(f"{data.title} - Josh Stockin"), |
14 | hg.META(name="title", content=f"{data.title} - Josh Stockin"), |
15 | hg.META(name="description", content=data.description), |
16 | hg.META(property="og:site_name", content="Josh Stockin"), |
17 | hg.META(property="og:title", content=f"{data.title} - Josh Stockin"), |
18 | hg.META(property="og:description", content=data.description), |
19 | hg.META(property="og:type", content="website"), |
20 | hg.META( |
21 | property="og:image", |
22 | content=data.thumbnail |
23 | if data.thumbnail != "" |
24 | else "https://joshstock.in/static/images/river.jpg", |
25 | ), |
26 | hg.META(property="og:url", content=f"https://joshstock.in{data.link}"), |
27 | hg.META(property="twitter:card", content="summary_large_image"), |
28 | ] |
29 |
|
30 | return contents |
31 |
|