Update Templates

This commit is contained in:
Robin Universe 2022-02-20 16:15:09 -06:00 committed by GitHub
parent 0385227468
commit 3a961271e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 107 additions and 3 deletions

34
templates/image.html Normal file
View file

@ -0,0 +1,34 @@
{% extends 'base.html' %}
<!--
{{ color }} - Custom Color Code set in the TwitFix Config
{{ appname }} - Custom Appname set in the TwitFix Config
{{ user }} - Username of the Source Tweet
{{ pic }} - Thumbnail Image for a given video
{{ vidlink }} - Direct link back to the source tweet
{{ vidurl }} - Direct MP4 link to the video contained in the tweet
{{ desc }} - Tweet Text
{{ url }} - Base URL of the site hosting TwitFix
{{ urlDesc }} - HTTP Encoded Tweet Text
{{ urlUser }} - HTTP Encoded Username
{{ urlLink }} - HTTP Encoded source link
{{ pfp }} - URL of the posters PFP
-->
{% block head %}
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="{{ color }}" data-react-helmet="true" name="theme-color" />
<meta property="og:site_name" content="{{ appname }}"/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="{{ user }} (@{{ screenName }})" />
<meta name="twitter:image" content="{{ pic }}" />
<meta name="twitter:creator" content="@{{ user }}" />
<meta property="og:description" content="{{ desc }}" />
<link rel="alternate" href="{{ url }}/oembed.json?desc={{ urlUser }}&user=Twitter&link={{ urlLink }}&ttype=photo" type="application/json+oembed" title="{{ user }}">
<meta http-equiv = "refresh" content = "0; url = {{ vidlink }}" />
{% endblock %}
{% block body %}
Redirecting you to the tweet in a moment. <a href="{{ vidlink }}">Or click here.</a>
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% block head %}
<title> TwitFix Latest</title>
<title> TwitFix {{ page }}</title>
<script>
window.onload = () => {
document.querySelector("#block>div").addEventListener('click', () => document.getElementById("block").style.display = "none");
@ -114,7 +114,7 @@
Potentially NSFW Content: Click here if you are over 18
</div>
</div>
<div><a href="{{ repo }}">TwitFix</a> Latest Video</div>
<div><a href="{{ repo }}">TwitFix</a> {{ page }} Video</div>
<div>WARNING: Video content is not screened so it may contain NSFW Content</div>
<video width="720" height="480" controls>
<source src="{{ vidlink }}" type="video/mp4">
@ -130,4 +130,4 @@
</div>
</div>
{% endblock %}
{% endblock %}

39
templates/text.html Normal file
View file

@ -0,0 +1,39 @@
{% extends 'base.html' %}
<!--
{{ color }} - Custom Color Code set in the TwitFix Config
{{ appname }} - Custom Appname set in the TwitFix Config
{{ user }} - Username of the Source Tweet
{{ pic }} - Thumbnail Image for a given video
{{ vidlink }} - Direct link back to the source tweet
{{ vidurl }} - Direct MP4 link to the video contained in the tweet
{{ desc }} - Tweet Text
{{ url }} - Base URL of the site hosting TwitFix
{{ urlDesc }} - HTTP Encoded Tweet Text
{{ urlUser }} - HTTP Encoded Username
{{ urlLink }} - HTTP Encoded source link
{{ pfp }} - URL of the posters PFP
{{ screenName }} - Users base username
{{ rts }} - Retweet Count
{{ likes }} - Like Count
{{ time }} - Time Created
-->
{% block head %}
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="{{ color }}" data-react-helmet="true" name="theme-color" />
<meta property="og:site_name" content="{{ appname }}"/>
<meta property="og:image" content="{{ pfp }}" />
<meta name="twitter:card" content="tweet" />
<meta name="twitter:title" content="{{ user }} (@{{ screenName }})" />
<meta name="twitter:image" content="{{ pic }}" />
<meta name="twitter:creator" content="@{{ user }}" />
<meta property="og:description" content="{{ desc }}" />
<link rel="alternate" href="{{ url }}/oembed.json?desc={{ urlUser }}&user=Twitter&link={{ urlLink }}&ttype=link" type="application/json+oembed" title="{{ user }}">
<meta http-equiv = "refresh" content = "0; url = {{ vidlink }}" />
{% endblock %}
{% block body %}
Redirecting you to the tweet in a moment. <a href="{{ vidlink }}">Or click here.</a>
{% endblock %}

31
templates/video.html Normal file
View file

@ -0,0 +1,31 @@
{% extends 'base.html' %}
{% block head %}
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
<meta content="{{ color }}" data-react-helmet="true" name="theme-color" />
<meta property="og:site_name" content="{{ appname }}">
<meta name="twitter:card" content="player" />
<meta name="twitter:title" content="{{ user }} (@{{ screenName }})" />
<meta name="twitter:image" content="{{ pic }}" />
<meta name="twitter:player:width" content="720" />
<meta name="twitter:player:height" content="480" />
<meta name="twitter:player:stream" content="{{ vidurl }}" />
<meta name="twitter:player:stream:content_type" content="video/mp4" />
<meta property="og:url" content="{{ vidlink }}" />
<meta property="og:video" content="{{ vidurl }}" />
<meta property="og:video:secure_url" content="{{ vidurl }}" />
<meta property="og:video:type" content="video/mp4" />
<meta property="og:video:width" content="720" />
<meta property="og:video:height" content="480" />
<meta name="twitter:title" content="{{ user }} (@{{ screenName }})" />
<meta property="og:image" content="{{ pic }}" />
<link rel="alternate" href="{{ url }}/oembed.json?desc={{ urlUser }}&user={{ urlDesc }}&link={{ urlLink }}&ttype=video" type="application/json+oembed" title="{{ user }}">
<meta http-equiv = "refresh" content = "0; url = {{ vidlink }}" />
{% endblock %}
{% block body %}
Redirecting you to the tweet in a moment. <a href="{{ vidlink }}">Or click here.</a>
{% endblock %}