Browse Source

add twitter cards

main
Colin McMillen 4 months ago
parent
commit
0db949fb2a
  1. 5
      build.py
  2. 5
      template.html

5
build.py

@ -114,14 +114,15 @@ def process_markdown_files():
html_content = markdown.markdown(
text, extensions=md_extensions, output_format='html5')
summary = find_summary(html_content)
output = template.format(
title=title, content=html_content, page_url=page_url)
title=title, content=html_content, page_url=page_url, summary=summary)
update_date = find_update_date(text)
if update_date:
blog_entry['url'] = 'https://www.mcmillen.dev/' + page_url
blog_entry['date'] = update_date
blog_entry['summary'] = find_summary(html_content)
blog_entry['summary'] = summary
blog_entry['content'] = html_content
blog_entries.append(blog_entry)

5
template.html

@ -15,6 +15,11 @@
<link href="https://fonts.googleapis.com/css?family=Fira+Mono:500&display=block" rel="stylesheet">
<link rel="stylesheet" href="/pygments.css">
<link rel="stylesheet" href="/style.css">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@mcmillen">
<meta name="twitter:title" content="{title}">
<meta name="twitter:description" content="{summary}">
</head>
<body>

Loading…
Cancel
Save