Skip to content

Commit cdd7e8d

Browse files
committed
favicon and robots
1 parent 036553a commit cdd7e8d

6 files changed

Lines changed: 24 additions & 4 deletions

File tree

sopy/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask
1+
from flask import Flask, send_file
22
from flask import render_template
33
from flask_alembic import Alembic
44
from flask_alembic.cli.click import cli as alembic_cli
@@ -48,6 +48,9 @@ def index():
4848

4949
return render_template('index.html', wod=Salad.word_of_the_day())
5050

51+
app.add_url_rule('/favicon.ico', None, app.send_static_file, defaults={'filename': 'favicon.ico'})
52+
app.add_url_rule('/robots.txt', None, app.send_static_file, defaults={'filename': 'robots.txt'})
53+
5154
@app.errorhandler(403)
5255
def forbidden(e):
5356
return render_template('errors/403.html'), 403

sopy/pages/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
def register(state):
88
from sopy.pages import views
99

10-
# alias /pages/chatroom to /chatroom
11-
state.app.add_url_rule('/chatroom', 'pages.page', view_func=views.page, defaults={'name': 'chatroom'})
10+
state.app.add_url_rule('/chatroom', None, views.page, defaults={'name': 'chatroom'})

sopy/static/favicon.ico

1.37 KB
Binary file not shown.

sopy/static/icon.png

-325 Bytes
Binary file not shown.

sopy/static/robots.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
User-agent: *
2+
Disallow: /auth/
3+
Disallow: /admin/
4+
Disallow: /canon/create
5+
Disallow: /canon/*/update
6+
Disallow: /canon/*/delete
7+
Disallow: /salad/create
8+
Disallow: /salad/*/update
9+
Disallow: /salad/*/delete
10+
Disallow: /salad/*/move_down
11+
Disallow: /salad/*/move_up
12+
Disallow: /transcript/create
13+
Disallow: /transcript/*/update
14+
Disallow: /transcript/*/delete
15+
Disallow: /wiki/create
16+
Disallow: /wiki/*/update
17+
Disallow: /wiki/*/delete
18+
Allow: /

sopy/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8"/>
55
<meta name="viewport" content="width=device-width, initial-scale=1"/>
66
<title>{% block full_title %}{% block title %}{% endblock %} - sopython{% endblock %}</title>
7-
<link rel="shortcut icon" type="image/png" href="{{ url_for('static', filename='icon.png') }}"/>
7+
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"/>
88
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/united/bootstrap.min.css"/>
99
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"/>
1010
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='app.css') }}"/>

0 commit comments

Comments
 (0)