From 415d03e7c0dc3dce978c506a52b8c7f8cea15a0e Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 14 Jul 2017 04:04:04 +0000 Subject: [PATCH] Change title to a variable and implement opengraph metatdata tags --- webapp/titanembeds/templates/about.html.j2 | 2 +- webapp/titanembeds/templates/add_bot.html.j2 | 2 +- webapp/titanembeds/templates/admin_index.html.j2 | 2 +- webapp/titanembeds/templates/administrate_guild.html.j2 | 2 +- webapp/titanembeds/templates/dashboard.html.j2 | 2 +- webapp/titanembeds/templates/embed.html.j2 | 5 ++++- webapp/titanembeds/templates/index.html.j2 | 2 +- webapp/titanembeds/templates/opengraph_tags.html.j2 | 5 +++++ webapp/titanembeds/templates/site_layout.html.j2 | 8 ++++++-- webapp/titanembeds/templates/usercss.html.j2 | 6 +++++- 10 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 webapp/titanembeds/templates/opengraph_tags.html.j2 diff --git a/webapp/titanembeds/templates/about.html.j2 b/webapp/titanembeds/templates/about.html.j2 index 161ed24..baeaf0e 100644 --- a/webapp/titanembeds/templates/about.html.j2 +++ b/webapp/titanembeds/templates/about.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}About Titan{% endblock %} +{% set title="About Titan" %} {% block content %}

In the beginning, there was silence.

diff --git a/webapp/titanembeds/templates/add_bot.html.j2 b/webapp/titanembeds/templates/add_bot.html.j2 index 7aad8e3..4a6b77a 100644 --- a/webapp/titanembeds/templates/add_bot.html.j2 +++ b/webapp/titanembeds/templates/add_bot.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}Adding bot to server{% endblock %} +{% set title="Adding bot to server" %} {% block content %}

Would you like to invite Titan to your server?

diff --git a/webapp/titanembeds/templates/admin_index.html.j2 b/webapp/titanembeds/templates/admin_index.html.j2 index 5e88938..6c2b851 100644 --- a/webapp/titanembeds/templates/admin_index.html.j2 +++ b/webapp/titanembeds/templates/admin_index.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}Admin{% endblock %} +{% set title="Admin" %} {% block content %} diff --git a/webapp/titanembeds/templates/administrate_guild.html.j2 b/webapp/titanembeds/templates/administrate_guild.html.j2 index bdc2868..547e35b 100644 --- a/webapp/titanembeds/templates/administrate_guild.html.j2 +++ b/webapp/titanembeds/templates/administrate_guild.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}Administrate Guild: {{ guild['name'] }}{% endblock %} +{% set title="Administrate Guild: " + guild['name'] %} {% block additional_head_elements %} diff --git a/webapp/titanembeds/templates/dashboard.html.j2 b/webapp/titanembeds/templates/dashboard.html.j2 index 06bc5fc..c13e606 100644 --- a/webapp/titanembeds/templates/dashboard.html.j2 +++ b/webapp/titanembeds/templates/dashboard.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}Dashboard{% endblock %} +{% set title="Dashboard" %} {% block content %}

User Dashboard

diff --git a/webapp/titanembeds/templates/embed.html.j2 b/webapp/titanembeds/templates/embed.html.j2 index 03ec2fb..5c81b29 100644 --- a/webapp/titanembeds/templates/embed.html.j2 +++ b/webapp/titanembeds/templates/embed.html.j2 @@ -1,5 +1,5 @@ - + @@ -12,6 +12,9 @@ {% include 'seo_meta.html.j2' %} + {% with title="Visit " + guild['name'] + " embed", description="Visit " + guild['name'] + " on Titan Embeds and chat with your friends from the comfort of your own website. This page is 100% embeddable, iFrameable and looks good on any webpages. Titan is hassle free and designed as easy to setup!", image=generate_guild_icon( guild['id'], guild['icon']) %} + {% include "opengraph_tags.html.j2" %} + {% endwith %} {{ guild['name'] }} - Embed - Titan Embeds for Discord {% include 'google_analytics.html.j2' %} diff --git a/webapp/titanembeds/templates/index.html.j2 b/webapp/titanembeds/templates/index.html.j2 index bc72993..92b853a 100644 --- a/webapp/titanembeds/templates/index.html.j2 +++ b/webapp/titanembeds/templates/index.html.j2 @@ -1,5 +1,5 @@ {% extends 'site_layout.html.j2' %} -{% block title %}Index{% endblock %} +{% set title="Index" %} {% block content %}

Embed Discord like a
true Titan

diff --git a/webapp/titanembeds/templates/opengraph_tags.html.j2 b/webapp/titanembeds/templates/opengraph_tags.html.j2 new file mode 100644 index 0000000..bcfe6c3 --- /dev/null +++ b/webapp/titanembeds/templates/opengraph_tags.html.j2 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/webapp/titanembeds/templates/site_layout.html.j2 b/webapp/titanembeds/templates/site_layout.html.j2 index b7e2397..d221ca5 100644 --- a/webapp/titanembeds/templates/site_layout.html.j2 +++ b/webapp/titanembeds/templates/site_layout.html.j2 @@ -1,5 +1,5 @@ - + @@ -10,10 +10,14 @@ - {% block title %}{% endblock %} - Titan Embeds for Discord + {{ title }} - Titan Embeds for Discord {% include 'seo_meta.html.j2' %} + {% with title=title, description="Embed your Discord server in any website. Titan is hassle free and designed as easy to setup." %} + {% include "opengraph_tags.html.j2" %} + {% endwith %} + {% block additional_head_elements %}{% endblock %} {% include 'google_analytics.html.j2' %} diff --git a/webapp/titanembeds/templates/usercss.html.j2 b/webapp/titanembeds/templates/usercss.html.j2 index 164029d..165c4bf 100644 --- a/webapp/titanembeds/templates/usercss.html.j2 +++ b/webapp/titanembeds/templates/usercss.html.j2 @@ -1,5 +1,9 @@ {% extends 'site_layout.html.j2' %} -{% block title %}{% if new %}New{% else %}Editing {{ css.name }} -{% endif %} User CSS{% endblock %} +{% if new %} + {% set title="New - User CSS" %} +{% else %} + {% set title="Editing " + css.name + " - User CSS" %} +{% endif %} {% block content %}

{% if new %}New{% else %}Editing {{ css.name }}{% endif %} - User Defined CSS