Commit 6d49a871 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Add support for preview cards

parent 9a7c8e7c
......@@ -158,7 +158,9 @@ def network_page(net):
desc = markdown.markdown(entry.description, extensions=['footnotes'])
return render_template('network.html', entry=entry, description=desc,
page=page, page_size=page_size)
description_text=entry.description.split("[^icon]")[0],
page=page, page_size=page_size,
thumb_alt=None if len(entry.files) == 1 else entry.files[0][1])
@app.route("/net/<net>/files/<filename>")
......
......@@ -5,7 +5,7 @@
<meta charset="utf-8">
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -->
<title>{% block title %}Netzschleuder: the network catalogue, repository and centrifuge {% endblock %}</title>
<meta name="description" content="Netzschleuder: the network centrifuge">
<meta name="description" content="Netzschleuder: the network centrifuge.">
<meta name="keywords" content="graph, network, network analysis, network science, network data, data, repository" />
<meta name="author" content="Tiago de Paula Peixoto <tiago@skewed.de>">
<meta name="HandheldFriendly" content="True">
......@@ -78,7 +78,16 @@
<script type="text/javascript" src="/static/MathJax/MathJax.js">
</script>
{% endblock %}
{% endblock %}
{% block opengraph %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@netzschleuder" />
<meta name="twitter:creator" content="@netzschleuder" />
<meta property="og:url" content="https://networks.skewed.de" />
<meta property="og:title" content="Netzschleuder" />
<meta property="og:description" content="Network catalogue, repository and centrifuge."/>
<meta property="og:image" content="https://networks.skewed.de/static/img/netzschleuder.png" />
{% endblock %}
</head>
<body>
......
......@@ -5,6 +5,25 @@
active
{% endblock %}
{% block opengraph %}
<meta name="description" content="{{description_text}}">
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="networks.skewed.de">
<meta property="twitter:url" content="https://networks.skewed.de/net/{{entry.name}}" />
<meta name="twitter:title" content="{{entry.name}} — {{entry.title}}" />
<meta name="twitter:description" content="{{description_text}}"/>
<meta name="twitter:image" content="https://networks.skewed.de/draw/{{entry.name}}/{{thumb_alt}}?thumb=True" />
<meta name="twitter:site" content="@netzschleuder" />
<meta name="twitter:creator" content="@netzschleuder" />
<meta property="og:url" content="https://networks.skewed.de/net/{{entry.name}}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{{entry.name}} — {{entry.title}}" />
<meta property="og:description" content="{{description_text}}"/>
<meta property="og:image" content="https://networks.skewed.de/draw/{{entry.name}}/{{thumb_alt}}?thumb=True" />
{% endblock %}
{% block content %}
<div class="column-group">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment