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] [extra]
email = "wes@wezm.net" email = "wes@wezm.net"
author = "Wesley Moore" author = "Wesley Moore"
twitter_name = "@wezm"
homepage = "https://www.wezm.net/" homepage = "https://www.wezm.net/"
juice_logo_name = "RSS Please" juice_logo_name = "RSS Please"
juice_logo_path = "feed-icon.svg" juice_logo_path = "feed-icon.svg"

View file

@ -31,6 +31,17 @@
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="index.xml", trailing_slash=false) }}"> <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="index.xml", trailing_slash=false) }}">
{% endblock %} {% 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 %} {% block fonts %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,16 @@
{% extends "juice/templates/page.html" %} {% extends "juice/templates/page.html" %}
{% block title %}{{ page.title }} - {{ config.title }} {% endblock title %} {% 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 %} {% block content %}
{% if page.description %} {% if page.description %}
<h1 class="heading-text">{{ page.description }}</h1> <h1 class="heading-text">{{ page.description }}</h1>

View file

@ -9,6 +9,16 @@
</header> </header>
{% endblock 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 %} {% block content %}
<h1 class="heading-text">{{ section.description }}</h1> <h1 class="heading-text">{{ section.description }}</h1>
{{ section.content | safe }} {{ section.content | safe }}

View file

@ -18,6 +18,8 @@
<link rel="stylesheet" href="{{ get_url(path="juice.css") }}"> <link rel="stylesheet" href="{{ get_url(path="juice.css") }}">
{% block head %} {% block head %}
{% endblock head %} {% endblock head %}
{% block metadata %}
{% endblock metadata %}
</head> </head>
<body> <body>