Skip to content

Commit

Permalink
Add url and publish datetime to og metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Apreche committed Sep 21, 2023
1 parent 5a4257d commit dbe962e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shows/templates/shows/content_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<meta property="og:title" content="{{ content.title }}" />
<meta property="og:description" content="{{ content.rendered_html|striptags }}" />
{% if content.image %}
<meta property="og:image" content="{{ content.image.url }}" />
<meta property="og:image" content="{{ content.image.url }}" />
{% elif content.show.logo %}
<meta property="og:image" content="{{ content.show.logo.url }}" />
<meta property="og:image" content="{{ content.show.logo.url }}" />
{% else %}
<meta property="og:image" content="{{request.scheme}}://{{request.META.HTTP_HOST}}{% static "img/large_logo.svg" %}" />
<meta property="og:image" content="{{request.scheme}}://{{request.META.HTTP_HOST}}{% static "img/large_logo.svg" %}" />
{% endif %}
<meta name="publish_date" property="og:publish_date" content="{{ content.pub_time|date:"Y-m-d" }}T{{content.pub_time|time:"H:i:sO"}}" />
{% endblock opengraphextra %}
{% block extrahead %}
{% comment "TODO" %}
Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{% block opengraph %}
<meta property="og:site_name" content="Front Row Crew" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ request.build_absolute_uri }}" />
{% block opengraphextra %}{% endblock opengraphextra %}
{% endblock opengraph %}
</head>
Expand Down

0 comments on commit dbe962e

Please sign in to comment.