Browse Source

Improve page titles and social media cards

main
discomrade 2 years ago
parent
commit
5df46e0c77
  1. 6
      inc/config.php
  2. 14
      templates/index.html
  3. 9
      templates/thread.html

6
inc/config.php

@ -2056,6 +2056,12 @@
* ====================
*/
// Site logo. This is used in the SEO tags and can be used in front page themes.
$config['logo'] = "static/logo.png";
// Base address of your imageboard for other sites to link pages and images. Probably should include $config['root'].
$config['SEO']['address'] = "https://exampleimageboard.net/";
// Meta keywords. It's probably best to include these in per-board configurations.
// $config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard';

14
templates/index.html

@ -14,7 +14,19 @@
</script>
{% include 'header.html' %}
<title>{{ board.url }} - {{ board.title|e }}</title>
{% set page_num %}{% for page in pages %}{% if page.selected %}{% if page.num != 1 %}{{ page.num }}{% endif %}{% endif %}{% endfor %}{% endset %}
<title>{{ board.url }} - {{ board.title|e }}{% if page_num %} - Page {{ page_num }}{% endif %}</title>
{% set meta_subject %}{{ board.subtitle|remove_paragraphs|e }}{% endset %}
<meta name="description" content="{{ meta_subject }}" />
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="{{ board.url }} - {{ board.title|e }}{% if page_num %} - Page {{ page_num }}{% endif %}" />
<meta name="twitter:description" content="{{ meta_subject }}" />
<meta name="twitter:image" content="{{ config.seo.address }}/{{ config.logo }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ config.seo.address }}/{{ board.uri }}/{% if page_num %}{{ page_num }}.html{% endif %}" />
<meta property="og:title" content="{{ board.url }} - {{ board.title|e }}{% if page_num %} - Page {{ page_num }}{% endif %}" />
<meta property="og:description" content="{{ meta_subject }}" />
<meta property="og:image" content="{{ config.seo.address }}/{{ config.logo }}" />
</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 %}">
{{ boardlist.top }}

9
templates/thread.html

@ -16,11 +16,14 @@
<meta name="description" content="{{ board.url }} - {{ board.title|e }} - {{ meta_desc }}" />
<meta name="twitter:card" value="summary">
<meta name="twitter:title" content="{{ meta_subject }}" />
<meta name="twitter:description" content="{{ meta_desc }}" />
{% if thread.files.0.thumb %}<meta name="twitter:image" content="{{ config.seo.address }}/{{ 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" />
{% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
<meta property="og:description" content="{{ thread.body_nomarkup|remove_modifiers|e }}" />
<meta property="og:url" content="{{ config.seo.address }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" />
{% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.seo.address }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
<meta property="og:description" content="{{ meta_desc }}" />
{% if isnoko50 %}<meta name="robots" content="noindex">{% endif %}
<title>{{ board.url }} - {{ meta_subject }}</title>
</head>

Loading…
Cancel
Save