Skip to content
Snippets Groups Projects
Commit b2155cad authored by HeJ's avatar HeJ
Browse files

Merge branch 'opengraph-headers' into 'develop'

Set meta tags for Open Graph in the header for events, projects and assemblies

See merge request hub/hub!1161
parents d58ee9e6 0df59d5a
No related branches found
No related tags found
No related merge requests found
......@@ -10,11 +10,16 @@
{% import "plainui/components/badge_elements.html.j2" as badge_elements with context %}
{% import "plainui/components/nav.html.j2" as navMacro with context %}
{% import "plainui/components/function_btns.html.j2" as fbtns with context %}
{% import "plainui/components/open_graph.html.j2" as ogMacro %}
{% block title %}
{{ conf.name }} - Assembly {{ assembly.name }}
{% endblock title %}
{% block head %}
{{ ogMacro.headers(assembly.name, site_name=conf.name, description=assembly.description, image=assembly.banner_image) }}
{% endblock head %}
{% block content %}
{{ navMacro.top_nav(_("Assembly") , has_breadcrumbs=True) }}
<ol class="breadcrumb hub-breadcrumbs">
......
{% macro headers(title, type="website", site_name=None, image=None, description=None) -%}
{% if site_name %}<meta property="og:site_name" content="{{ site_name }}" />{% endif %}
<meta property="og:title"
content="{%- if site_name -%}{{ site_name }}: {%- endif -%}{{ title }}" />
<meta property="og:type" content="{{ type }}" />
{% if image %}
<meta property="og:image" content="{{ image.url }}" />
<meta property="og:image:width" content="{{ image.width }}" />
<meta property="og:image:height" content="{{ image.height }}" />
<meta property="og:image:alt" content="{{ image.name }}" />
{% endif %}
{% if description %}
<meta property="og:description"
content="{{ description | truncate(250, True) }}" />
{% endif %}
{%- endmacro %}
......@@ -10,6 +10,7 @@
{% import "plainui/components/image.html.j2" as imageMacro %}
{% import "plainui/components/map.html.j2" as mapMacro %}
{% import "plainui/components/event.html.j2" as eventMacro %}
{% import "plainui/components/open_graph.html.j2" as ogMacro %}
{%- macro random_preview_image_url() -%}
{%- set imgs = [1, 2, 3, 4, 5, 6, 7] -%}
......@@ -23,6 +24,7 @@
{% endblock title %}
{% block head %}
{{ ogMacro.headers(event.name, site_name=conf.name, description=event.description, image=event.banner_image) }}
<script src="{{ static('plainui/vendor/vocplayer/player.umd.js') }}"></script>
<link href="{{ static('plainui/vendor/vocplayer/style.css') }}"
rel="stylesheet">
......
......@@ -4,11 +4,17 @@
{% import "plainui/components/image.html.j2" as imageMacro %}
{% import "plainui/components/tagbox.html.j2" as tagMacros %}
{% import "plainui/components/function_btns.html.j2" as fbtns with context %}
{% import "plainui/components/open_graph.html.j2" as ogMacro %}
{% extends "plainui/base.html.j2" %}
{% block title %}
Conference {{ conf.name }} - Project {{ project.name }}
{% endblock title %}
{% block head %}
{{ ogMacro.headers(project.name, site_name=conf.name, description=project.description, image=project.banner_image) }}
{% endblock head %}
{% block content %}
{{ navMacro.top_nav(_("Project") , has_breadcrumbs=True) }}
<nav aria-label="breadcrumb">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment