Add meta tags to templates

This commit is contained in:
BBaoVanC 2022-01-11 19:48:19 -06:00
parent 3f503442f1
commit 2da7f6c7c7
No known key found for this signature in database
GPG Key ID: 18089E4E3CCF1D3A
7 changed files with 69 additions and 10 deletions

View File

@ -2,6 +2,17 @@
{% block title %}{{sitename}} - API{% endblock %} {% block title %}{{sitename}} - API{% endblock %}
{% block opengraph %}
<meta property="og:title" content="{{ sitename }} - API" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
{% endblock %}
{% block twittercard %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ sitename }} - API" />
{% endblock %}
{% block head %} {% block head %}
<link href="{{ sitepath }}static/css/github-markdown.css" rel="stylesheet" type="text/css"> <link href="{{ sitepath }}static/css/github-markdown.css" rel="stylesheet" type="text/css">
{% endblock %} {% endblock %}
@ -151,4 +162,4 @@ DELETED</code></pre>
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -9,6 +9,19 @@
<link href='{{ sitepath }}static/css/hint.css' rel='stylesheet' type='text/css'> <link href='{{ sitepath }}static/css/hint.css' rel='stylesheet' type='text/css'>
<link href='{{ sitepath }}static/images/favicon.gif' rel='icon' type='image/gif'> <link href='{{ sitepath }}static/images/favicon.gif' rel='icon' type='image/gif'>
{% block head %}{% endblock %} {% block head %}{% endblock %}
<meta name="og:site_name" content="{{ sitename }}" />
<meta name="twitter:site" content="{{ sitename }}" />
{% block opengraph %}
<meta property="og:title" content="{{ sitename }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
{% endblock %}
{% block twittercard %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ sitename }}" />
{% endblock %}
</head> </head>
<body> <body>
@ -37,4 +50,4 @@
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,8 +1,12 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block head %} {% block opengraph %}
<meta property="og:title" content="{{ filename }} ({{ size }})" />
<meta property="og:type" content="music:song" />
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
<meta property="og:audio" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" /> <meta property="og:audio" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
<meta property="og:audio:secure_url" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" /> <meta property="og:audio:secure_url" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
<meta property="og:audio:type" content="{{ mime }}" />
{% endblock %} {% endblock %}
{% block main %} {% block main %}
@ -10,4 +14,4 @@
<source src='{{ sitepath }}{{ selifpath }}{{ filename }}'> <source src='{{ sitepath }}{{ selifpath }}{{ filename }}'>
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a> <a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
</audio> </audio>
{% endblock %} {% endblock %}

View File

@ -1,5 +1,16 @@
{% extends "../base.html" %} {% extends "../base.html" %}
{% block opengraph %}
<meta property="og:title" content="{{ filename }} ({{ size }})" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
{% endblock %}
{% block twittercard %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ filename }} ({{ size }})" />
{% endblock %}
{% block title %}{{sitename}} - {{ filename }}{% endblock %} {% block title %}{{sitename}} - {{ filename }}{% endblock %}
{% block bodymore %}{% endblock %} {% block bodymore %}{% endblock %}
@ -33,4 +44,4 @@
</div> </div>
<script src="{{ sitepath }}static/js/clipboard.js"></script> <script src="{{ sitepath }}static/js/clipboard.js"></script>
{% endblock %} {% endblock %}

View File

@ -1,10 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block head %} {% block opengraph %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" /> <meta property="og:image" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
{% endblock %} {% endblock %}
{% block twittercard %}
<meta name="twitter:image" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:text:title" content="{{ filename }} ({{ size }})" />
{% endblock %}
{% block main %} {% block main %}
<a href="{{ sitepath }}{{ selifpath }}{{ filename }}"> <a href="{{ sitepath }}{{ selifpath }}{{ filename }}">
<img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" /> <img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" />

View File

@ -1,13 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block head %} {% block opengraph %}
<meta property="og:title" content="{{ filename }} ({{ size }})" />
<meta property="og:type" content="video.other"> <meta property="og:type" content="video.other">
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
<meta property="og:video" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" /> <meta property="og:video" content="{{ siteurl }}{{ sitepath }}{{ selifpath }}{{ filename }}" />
{% endblock %} {% endblock %}
{% block twittercard %}{% endblock %}
{% block main %} {% block main %}
<video class="display-video" controls autoplay> <video class="display-video" controls autoplay>
<source src="{{ sitepath }}{{ selifpath }}{{ filename }}" /> <source src="{{ sitepath }}{{ selifpath }}{{ filename }}" />
<a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a> <a href='{{ sitepath }}{{ selifpath }}{{ filename }}'>Download it instead</a>
</video> </video>
{% endblock %} {% endblock %}

View File

@ -2,6 +2,17 @@
{% block title %}{{sitename}} - Paste{% endblock %} {% block title %}{{sitename}} - Paste{% endblock %}
{% block opengraph %}
<meta property="og:title" content="{{ sitename }} - Paste" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ siteurl }}{{ sitepath }}{{ filename }}" />
{% endblock %}
{% block twittercard %}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ sitename }} - Paste" />
{% endblock %}
{% block content %} {% block content %}
<form id="reply" action='{{ sitepath }}upload' method='post'> <form id="reply" action='{{ sitepath }}upload' method='post'>
<div id="main" class="paste"> <div id="main" class="paste">
@ -38,4 +49,4 @@
<script src="{{ sitepath }}static/js/util.js"></script> <script src="{{ sitepath }}static/js/util.js"></script>
<script src="{{ sitepath }}static/js/paste.js"></script> <script src="{{ sitepath }}static/js/paste.js"></script>
{% endblock %} {% endblock %}