Spaces:
Running
Running
Commit ·
436bbab
1
Parent(s): ef710c0
feat: added favicons
Browse files- app/blueprints/main.py +14 -1
- app/templates/base.html +5 -0
- favicon/about.txt +6 -0
- favicon/android-chrome-192x192.png +0 -0
- favicon/android-chrome-512x512.png +0 -0
- favicon/apple-touch-icon.png +0 -0
- favicon/favicon-16x16.png +0 -0
- favicon/favicon-32x32.png +0 -0
- favicon/favicon.ico +0 -0
- favicon/site.webmanifest +1 -0
app/blueprints/main.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
-
from
|
|
|
|
|
|
|
| 2 |
from flask_login import current_user, login_required, logout_user
|
| 3 |
from flask_dance.contrib.discord import discord
|
| 4 |
from flask_dance.contrib.google import google
|
|
@@ -6,6 +8,7 @@ from flask_dance.contrib.google import google
|
|
| 6 |
from app.models import Note
|
| 7 |
|
| 8 |
main_bp = Blueprint("main", __name__)
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
@main_bp.route("/")
|
|
@@ -58,3 +61,13 @@ def logout():
|
|
| 58 |
logout_user()
|
| 59 |
|
| 60 |
return redirect(url_for("main.login"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
|
| 3 |
+
from flask import Blueprint, redirect, render_template, send_from_directory, url_for
|
| 4 |
from flask_login import current_user, login_required, logout_user
|
| 5 |
from flask_dance.contrib.discord import discord
|
| 6 |
from flask_dance.contrib.google import google
|
|
|
|
| 8 |
from app.models import Note
|
| 9 |
|
| 10 |
main_bp = Blueprint("main", __name__)
|
| 11 |
+
FAVICON_DIR = Path(__file__).resolve().parents[2] / "favicon"
|
| 12 |
|
| 13 |
|
| 14 |
@main_bp.route("/")
|
|
|
|
| 61 |
logout_user()
|
| 62 |
|
| 63 |
return redirect(url_for("main.login"))
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
@main_bp.route("/favicon/<path:filename>")
|
| 67 |
+
def favicon_files(filename):
|
| 68 |
+
return send_from_directory(FAVICON_DIR, filename)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
@main_bp.route("/favicon.ico")
|
| 72 |
+
def favicon():
|
| 73 |
+
return send_from_directory(FAVICON_DIR, "favicon.ico")
|
app/templates/base.html
CHANGED
|
@@ -4,6 +4,11 @@
|
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
<title>{% block title %}PoraHobeBot{% endblock %}</title>
|
| 8 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
|
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('main.favicon_files', filename='apple-touch-icon.png') }}">
|
| 8 |
+
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('main.favicon_files', filename='favicon-32x32.png') }}">
|
| 9 |
+
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('main.favicon_files', filename='favicon-16x16.png') }}">
|
| 10 |
+
<link rel="icon" href="{{ url_for('main.favicon') }}">
|
| 11 |
+
<link rel="manifest" href="{{ url_for('main.favicon_files', filename='site.webmanifest') }}">
|
| 12 |
<title>{% block title %}PoraHobeBot{% endblock %}</title>
|
| 13 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 14 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
favicon/about.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This favicon was generated using the following font:
|
| 2 |
+
|
| 3 |
+
- Font Title: IBM Plex Mono
|
| 4 |
+
- Font Author: undefined
|
| 5 |
+
- Font Source: https://fonts.gstatic.com/s/ibmplexmono/v19/-F6qfjptAgt5VM-kVkqdyU8n3vAO8ldPg-IUDNg.ttf
|
| 6 |
+
- Font License: undefined)
|
favicon/android-chrome-192x192.png
ADDED
|
|
favicon/android-chrome-512x512.png
ADDED
|
|
favicon/apple-touch-icon.png
ADDED
|
|
favicon/favicon-16x16.png
ADDED
|
|
favicon/favicon-32x32.png
ADDED
|
|
favicon/favicon.ico
ADDED
|
|
favicon/site.webmanifest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|