Add OpenGraph metadata

This commit is contained in:
Wesley Moore 2024-03-10 15:30:18 +10:00
parent 7fc28a6215
commit 528ef17e6d
No known key found for this signature in database
5 changed files with 36 additions and 2 deletions

View file

@ -24,6 +24,7 @@ smart_punctuation = true
[extra]
email = "wes@wezm.net"
author = "Wesley Moore"
twitter_name = "@wezm"
homepage = "https://www.wezm.net/"
juice_logo_name = "RSS Please"
juice_logo_path = "feed-icon.svg"

View file

@ -1,5 +1,5 @@
{% extends "juice/templates/index.html" %}
{% block title %}{{ section.title }} - {{ section.description }} {% endblock title %}
{% block title %}{{ section.title }} - {{ section.description }}{% endblock title %}
{% block hero %}
<section class="text-center">
@ -31,6 +31,17 @@
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="index.xml", trailing_slash=false) }}">
{% endblock %}
{% block metadata %}
<meta property="og:url" content="{{ section.permalink }}" />
<meta property="og:title" content="{{ section.title }}" />
<meta property="og:description" content="{{ section.description | default(value="") | striptags }}" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_AU" />
<meta property="og:image" content="{{ get_url(path="screenshot.png") }}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="{{ config.extra.twitter_name }}" />
{% endblock %}
{% block fonts %}
{% endblock %}

View file

@ -1,6 +1,16 @@
{% extends "juice/templates/page.html" %}
{% block title %}{{ page.title }} - {{ config.title }} {% endblock title %}
{% block metadata %}
<meta property="og:url" content="{{ page.permalink }}" />
<meta property="og:title" content="{{ page.title }} - {{ config.title }}" />
<meta property="og:description" content="{{ page.summary | default(value="") | striptags }}" />
<meta property="og:type" content="article" />
<meta property="og:locale" content="en_AU" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="{{ config.extra.twitter_name }}" />
{% endblock %}
{% block content %}
{% if page.description %}
<h1 class="heading-text">{{ page.description }}</h1>

View file

@ -9,6 +9,16 @@
</header>
{% endblock header %}
{% block metadata %}
<meta property="og:url" content="{{ section.permalink }}" />
<meta property="og:title" content="{{ config.title }} - {{ section.title }}" />
<meta property="og:description" content="{{ section.description | default(value="") | striptags }}" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_AU" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="{{ config.extra.twitter_name }}" />
{% endblock %}
{% block content %}
<h1 class="heading-text">{{ section.description }}</h1>
{{ section.content | safe }}

View file

@ -18,6 +18,8 @@
<link rel="stylesheet" href="{{ get_url(path="juice.css") }}">
{% block head %}
{% endblock head %}
{% block metadata %}
{% endblock metadata %}
</head>
<body>
@ -141,4 +143,4 @@
items.forEach(item => observer.observe(item));
</script>
</html>
</html>