Skip to content

Commit 9ab2bc4

Browse files
committed
start adding opengraph data
1 parent 88619ad commit 9ab2bc4

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

generate-html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def html_path(self):
2828

2929
@property
3030
def url(self):
31-
return f"blog/{self.html_path.name}"
31+
return f"/blog/{self.html_path.name}"
3232

3333

3434

@@ -51,7 +51,7 @@ def main():
5151
title=_md.Meta['title'][0],
5252
)
5353
post_html = env.get_template(TEMPLATE_FILE).render(
54-
content=html_content, url=post.html_path, post=post,
54+
content=html_content, url=post.url, post=post,
5555
)
5656
print("writing", post.html_path)
5757
post.html_path.write_text(post_html)

templates/base.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
<html lang="en">
33

44
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="author" content="Harry Percival and Bob Gregory">
8-
<meta name="description" content="">
5+
<title>{% block title %}cosmic_python{% endblock %}</title>
6+
<meta charset="utf-8">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<meta name="author" content="Harry Percival and Bob Gregory">
9+
<meta name="description" content="">
10+
<meta property="og:title" content="cosmic_python" />
11+
<meta property="og:type" content="website" />
12+
<meta property="og:url" content="https://www.cosmicpython.com{% block url_path %}{% endblock %}" />
13+
<meta property="og:image" content="https://www.cosmicpython.com/images/lobster-nebula.jpg" />
914
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
1015
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
1116
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css">
1217
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/friendly.css">
1318
<link rel="stylesheet" href="/styles.css">
19+
1420
</head>
1521

1622
<body>
17-
<main class="wrapper">
23+
<main class="wrapper">
1824

19-
<nav class="navigation">
20-
<section class="container">
21-
<a class="navigation-title" href="/">
22-
<h1 class="title">Cosmic Python</h1>
23-
</a>
25+
<nav class="navigation">
26+
<section class="container">
27+
<a class="navigation-title" href="/">
28+
<h1 class="title">Cosmic Python</h1>
29+
</a>
2430
</section>
2531
</nav>
2632

0 commit comments

Comments
 (0)