Index

joshstock.in / f8eb074

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
15914 Jan 2023 23:42e2bc780Use large summary meta imageJosh Stockin111G

Blob @ joshstock.in / site / generators / head / meta.py

application/x-python1229 bytesdownload raw
1from .._variables import verify
2import htmlgenerator as hg
3
4
5def 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