Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WWW
IA-Short
Commits
8549c098
Commit
8549c098
authored
Feb 24, 2019
by
132ikl
Browse files
Fix favicon for subdomains
parent
6df1ce16
Changes
2
Hide whitespace changes
Inline
Side-by-side
liteshort.py
View file @
8549c098
...
...
@@ -3,8 +3,9 @@
# This software is license under the MIT license. It should be included in your copy of this software.
# A copy of the MIT license can be obtained at https://mit-license.org/
from
flask
import
Flask
,
current_app
,
flash
,
g
,
jsonify
,
redirect
,
render_template
,
request
,
url_for
from
flask
import
Flask
,
current_app
,
flash
,
g
,
jsonify
,
redirect
,
render_template
,
request
,
send_from_directory
,
url_for
import
bcrypt
import
os
import
random
import
sqlite3
import
time
...
...
@@ -193,6 +194,12 @@ app.secret_key = app.config['secret_key']
app
.
config
[
'SERVER_NAME'
]
=
app
.
config
[
'site_domain'
]
@
app
.
route
(
'/favicon.ico'
)
def
favicon
():
return
send_from_directory
(
os
.
path
.
join
(
app
.
root_path
,
'static'
),
'favicon.ico'
,
mimetype
=
'image/vnd.microsoft.icon'
)
@
app
.
route
(
'/'
,
subdomain
=
app
.
config
[
'subdomain'
])
def
main
():
return
response
(
request
,
True
)
...
...
templates/main.html
View file @
8549c098
...
...
@@ -9,7 +9,6 @@ A copy of the MIT license can be obtained at https://mit-license.org/
<head>
<meta
charset=
"UTF-8"
>
<title>
{{ config.site_name }}
</title>
<link
rel=
"shortcut icon"
href=
"{{ url_for('static', filename='favicon.ico') }}"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/purecss@1.0.0/build/pure-min.css"
>
<link
href=
"https://fonts.googleapis.com/css?family=Open+Sans"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename='styles.css') }}"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment