new: Add OpenGraph cards

pull/156/head
Raphaël Vinot 2021-01-17 12:41:01 +01:00
parent 72463cc898
commit 026e0b7269
4 changed files with 40 additions and 5 deletions

View File

@ -361,7 +361,7 @@ def tree(tree_uuid: str, urlnode_uuid: Optional[str]=None):
return render_template('tree.html', tree_json=ct.to_json(),
start_time=ct.start_time.isoformat(),
user_agent=ct.user_agent, root_url=ct.root_url,
tree_uuid=tree_uuid,
tree_uuid=tree_uuid, public_domain=lookyloo.public_domain,
screenshot_thumbnail=b64_thumbnail, page_title=cache.title,
meta=meta, enable_mail_notification=enable_mail_notification,
enable_context_by_users=enable_context_by_users,

View File

@ -5,6 +5,23 @@
{% block title %}Lookyloo{% endblock %}
{% block card %}
<meta name="og:title" content="Lookyloo" />
<meta name="og:type" content="website"/>
<meta
name="og:description"
content="Lookyloo captures websites and let you investigate them."
/>
<meta
name="og:image"
content="//{{public_domain}}{{ url_for('static', filename='favicon.ico') }}"
/>
<meta
name="og:url"
content="//{{public_domain}}"
/>
{% endblock %}
{% block scripts %}
{{ super() }}
<script src='{{ url_for('static', filename='datatables.min.js') }}'></script>

View File

@ -12,9 +12,10 @@
{{ bootstrap.load_css() }}
<link rel="stylesheet" href="{{ url_for('static', filename='tree.css') }}">
{% endblock %}
<title>
{% block title %}{% endblock%}
</title>
<title>{% block title %}{% endblock%}</title>
{% block card %}{% endblock %}
{% endblock %}
</head>
<body>

View File

@ -3,7 +3,24 @@
{% from 'bootstrap/utils.html' import render_messages %}
{% from "macros.html" import shorten_string %}
{% block title %}Tree{% endblock %}
{% block title %}Capture of {{root_url}}{% endblock %}
{% block card %}
<meta name="og:title" content="Lookyloo capture" />
<meta name="og:type" content="website"/>
<meta
name="og:description"
content="URL captured: {{root_url}}"
/>
<meta
name="og:image"
content="//{{public_domain}}{{ url_for('image', tree_uuid=tree_uuid) }}"
/>
<meta
name="og:url"
content="//{{public_domain}}{{ url_for('tree', tree_uuid=tree_uuid) }}"
/>
{% endblock %}
{% block scripts %}
{{ super() }}