Skip to content

Commit

Permalink
add twitter card
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-24 committed Aug 13, 2024
1 parent c46885d commit aeba3c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions AM_Nihoul_website/templates/album.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% block og_description %}Un album photo de l'{{ site_name }}{% endblock %}
{% block og_type %}article{% endblock %}
{% block og_image %}{% if album.thumbnail %}{{ album.thumbnail.url() }}{% else %}{{ super() }}{% endif %}{% endblock %}
{% block og_image_alt %}{% if album.thumbnail %}La miniature de l'album{% else %}{{ super() }}{% endif %}{% endblock %}

{% block extra_meta %}
<meta property="og:article:published_time" content="{{ album.date_created }}" />
Expand Down
9 changes: 8 additions & 1 deletion AM_Nihoul_website/templates/base.ex.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
<meta name="description" content="{{ site_description }}">
<meta name="keywords" content="{{ site_keywords }}">

<!-- facebook og -->
<!-- facebook og / twitter card -->
<meta property="og:type" content="{% block og_type %}website{% endblock %}" />
<meta property="og:title" content="{% block og_title %}{{ self.page_title() }}{% endblock %}" />
<meta property="og:description" content="{% block og_description %}{{ site_description }}{% endblock %}" />
<meta property="og:image" content="{% block og_image %}{{ url_for('static', filename='images/facebook_placeholder.jpg', _external=True) }}{% endblock %}" />
<meta property="og:image:alt" content="{% block og_image_alt %}Le logo de l'association{% endblock %}" />

<meta name="twitter:card" content="{{ self.og_type() }}" />
<meta name="twitter:title" content="{{ self.og_title() }}" />
<meta name="twitter:description" content="{{ self.og_description() }}" />
<meta name="twitter:image" content="{{ self.og_image() }}" />
<meta name="twitter:image:alt" content="{{ self.og_image_alt() }}" />

{% block extra_meta %}{% endblock %}

Expand Down

0 comments on commit aeba3c6

Please sign in to comment.