add opengraph metadata for preview cards
This commit is contained in:
parent
b0a2f7ec7c
commit
16e7ea4806
7 changed files with 44 additions and 5 deletions
|
@ -1,6 +1,8 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Download not found - transbeam{% endblock %}
|
||||
{% block og_title %}Download not found{% endblock %}
|
||||
{% block og_description %}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<script src="js/download-landing.js?{{ cachebuster }}"></script>
|
||||
|
|
|
@ -3,12 +3,18 @@
|
|||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta name="color-scheme" content="light dark"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/transbeam.css?{{ cachebuster }}"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/colors.css?{{ cachebuster }}"/>
|
||||
<link rel="apple-touch-icon" href="images/site-icons/transbeam-apple.png"/>
|
||||
<link rel="manifest" href="manifest.json"/>
|
||||
<title>{% block title %}transbeam{% endblock %}</title>
|
||||
<meta name="og:type" content="website"/>
|
||||
<meta name="og:site_name" content="transbeam"/>
|
||||
<meta name="og:title" content="{% block og_title %}transbeam{% endblock %}"/>
|
||||
<meta name="og:description" content="{% block og_description %}Low-latency file-drop web app{% endblock %}"/>
|
||||
<meta name="og:image" content="{{ base_url }}/images/site-icons/transbeam-192.png"/>
|
||||
<meta name="og:url" content="{{ base_url }}/{% block relative_path %}{% endblock %}"/>
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
<body {% block body_attrs %}{% endblock %}>
|
||||
|
|
|
@ -2,6 +2,19 @@
|
|||
|
||||
{% block title %}{{ info.file.name }} - transbeam{% endblock %}
|
||||
|
||||
{% block og_title %}{{ info.file.name }}{% endblock %}
|
||||
{% block og_description -%}
|
||||
{% let formatted_total_size = bytesize::to_string(info.file.size.clone(), false).replace(" ", "") -%}
|
||||
{% match info.file.contents -%}
|
||||
{% when Some with (files) -%}
|
||||
{{ files.len() }} files, {{ formatted_total_size }} total
|
||||
{%- else -%}
|
||||
{{ formatted_total_size }}
|
||||
{%- endmatch %}, expires {{ info.file.expiry.format(DATE_DISPLAY_FORMAT).unwrap() }}
|
||||
{%- endblock %}
|
||||
|
||||
{% block relative_path %}download?code={{ info.code }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<script src="js/util.js?{{ cachebuster }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue