Skip to content

Commit

Permalink
Opengraph setup
Browse files Browse the repository at this point in the history
  • Loading branch information
liamjohnston authored and haydngreatnews committed Jul 14, 2024
1 parent 2f4b6c2 commit 7bbb398
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Binary file added static/images/alt-modes/purple/cdhlogo_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/cdhlogo_square.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 7 additions & 14 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

<head>
<meta charset="utf-8">
<title>{% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %}</title>
<meta name="description" content="{% firstof self.search_description self.intro|default:''|striptags self.body_excerpt|default:''|striptags|truncatewords:40 self.title %}">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>{% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %}</title>

{% include "includes/favicons.html" %}
{% include "snippets/head_meta.html" %}

<script type="text/javascript"> window.staticRoot = "{% static 'dist/' %}"; </script>

Expand All @@ -16,22 +19,12 @@
document.documentElement.classList.add('js');
</script>

{% include "includes/favicons.html" %}

{% comment %}
{% include "core/includes/meta/twitter_card.html" %}
{% include "core/includes/meta/open_graph.html" %}

{% block og_images %}
{% include "core/includes/meta/open_graph_image.html" %}
{% endblock %}

{% endcomment %}
{% block extra_css %}
{# Needed for specific cases #}
{% endblock %}

<script defer src="{% static 'dist/main.js' %}"></script><link href="{% static 'dist/styles.css' %}" rel="stylesheet"></head>
<script defer src="{% static 'dist/main.js' %}"></script>
<link href="{% static 'dist/styles.css' %}" rel="stylesheet">

</head>
<body class="{% block body_class %}{% endblock %}">
Expand Down
2 changes: 1 addition & 1 deletion templates/snippets/head_meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% autoescape on %}
{# html metadata #}
{% if page.tags.exists %}<meta name="keywords" content="{{ page.tags.all|join:', ' }}"/>{% endif %}
{% if meta_description %}<meta name="description" content="{{ meta_description|striptags }}"/>{% endif %}
<meta name="description" content="{% firstof self.search_description self.intro|default:''|striptags self.body_excerpt|default:''|striptags|truncatewords:40 self.title %}">
{# determine preview image: specified by page, cdh icon based on url, or default image #}
{# open graph metadata #}
<meta property="og:title" content="{{ meta_title }}" />
Expand Down

0 comments on commit 7bbb398

Please sign in to comment.