Skip to content

Commit

Permalink
Improve social media cards
Browse files Browse the repository at this point in the history
  • Loading branch information
discomrade authored and Zankaria committed Apr 24, 2024
1 parent 4bb0f40 commit 735180c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions templates/index.html
Expand Up @@ -14,6 +14,18 @@
</script>

{% include 'header.html' %}

{% set meta_subject %}{% if config.thread_subject_in_title and thread.subject %}{{ thread.subject|e }}{% else %}{{ thread.body_nomarkup|remove_modifiers[:256]|e }}{% endif %}{% endset %}

<meta name="description" content="{{ meta_subject }}" />
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="{{ board.url }} - {{ board.title|e }}" />
<meta name="twitter:description" content="{{ meta_subject }}" />
<meta name="twitter:image" content="{{ config.domain }}/{{ config.logo }}" />
<meta property="og:title" content="{{ board.url }} - {{ board.title|e }}" />
<meta property="og:type" content="article" />
<meta property="og:image" content="{{ config.domain }}/{{ config.logo }}" />
<meta property="og:description" content="{{ meta_subject }}" />
<title>{{ board.url }} - {{ board.title|e }}</title>
</head>
<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} active-{% if not no_post_form %}index{% else %}ukko{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
Expand Down
9 changes: 8 additions & 1 deletion templates/themes/categories/frames.html
@@ -1,7 +1,14 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="{{ settings.title }}" />
<meta name="twitter:image" content="{{ config.domain }}/{{ config.logo }}" />
<meta property="og:title" content="{{ settings.title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ config.domain }}" />
<meta property="og:image" content="{{ config.domain }}/{{ config.logo }}" />
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
<style type="text/css">
iframe{border:none;margin:0;padding:0;height:99%;position:absolute}
Expand Down
3 changes: 3 additions & 0 deletions templates/thread.html
Expand Up @@ -15,6 +15,9 @@

<meta name="description" content="{{ board.url }} - {{ board.title|e }} - {{ meta_subject }}" />
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="{{ meta_subject }}" />
<meta name="twitter:description" content="{{ thread.body_nomarkup|e }}" />
{% if thread.files.0.thumb %}<meta name="twitter:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
<meta property="og:title" content="{{ meta_subject }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" />
Expand Down

0 comments on commit 735180c

Please sign in to comment.