Add search-engine files, a favicon, and 404 page. Close #70, #71.tags/v1.0^2
@@ -12,7 +12,7 @@ from bitshift.database import Database | |||||
from bitshift.languages import LANGS | from bitshift.languages import LANGS | ||||
from bitshift.query import parse_query, QueryParseException | from bitshift.query import parse_query, QueryParseException | ||||
app = Flask(__name__) | |||||
app = Flask(__name__, static_folder="static", static_url_path="") | |||||
app.config.from_object("bitshift.config") | app.config.from_object("bitshift.config") | ||||
app.jinja_env.globals.update(year=datetime.datetime.now().year) | app.jinja_env.globals.update(year=datetime.datetime.now().year) | ||||
@@ -56,11 +56,9 @@ def about(): | |||||
def developers(): | def developers(): | ||||
return render_template("developers.html") | return render_template("developers.html") | ||||
@app.route("/robots.txt") | |||||
@app.route("/sitemap.xml") | |||||
@app.route("/favicon.ico") | |||||
def static_from_root(): | |||||
return flask.send_from_directory(app.static_folder, request.path[1:]) | |||||
@app.errorhandler(404) | |||||
def error404(error): | |||||
return render_template("error404.html"), 404 | |||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
app.run(debug=True) | app.run(debug=True) |
@@ -5,8 +5,8 @@ | |||||
from flask import Markup | from flask import Markup | ||||
ASSET_HTML_TEMPLATES = { | ASSET_HTML_TEMPLATES = { | ||||
'css': "<link rel='stylesheet' type='text/css' href='/static/css/%s'>", | |||||
'js': "<script src='/static/js/%s'></script>" | |||||
'css': "<link rel='stylesheet' type='text/css' href='/css/%s'>", | |||||
'js': "<script src='/js/%s'></script>" | |||||
} | } | ||||
def tag(filename): | def tag(filename): | ||||
@@ -0,0 +1 @@ | |||||
google-site-verification: google10335120a3066831.html |
@@ -0,0 +1,6 @@ | |||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |||||
ga('create', 'UA-51910807-1', 'bitshift.it'); | |||||
ga('send', 'pageview'); |
@@ -0,0 +1,23 @@ | |||||
@import variables | |||||
div#message | |||||
color: $baseColor1 | |||||
font-family: monospace | |||||
font-size: 700% | |||||
font-weight: normal | |||||
margin-top: 8% | |||||
text-align: center | |||||
span | |||||
&#error-num | |||||
font-size: 170% | |||||
vertical-align: middle | |||||
&.c1 | |||||
color: $baseColor1 | |||||
&.c2 | |||||
color: $baseColor2 | |||||
&.c3 | |||||
color: $baseColor3 |
@@ -35,10 +35,12 @@ div#container | |||||
background-color: $baseColor1 | background-color: $baseColor1 | ||||
bottom: -30px | bottom: -30px | ||||
height: 60px | height: 60px | ||||
padding-bottom: 5px | |||||
padding-top: 15px | padding-top: 15px | ||||
position: fixed | position: fixed | ||||
text-align: center | text-align: center | ||||
width: 100% | width: 100% | ||||
z-index: 100 | |||||
&:hover | &:hover | ||||
@include delay(0s) | @include delay(0s) | ||||
@@ -0,0 +1,14 @@ | |||||
= extends "layout.html" | |||||
= block head | |||||
{{ assets.tag("error404.css") }} | |||||
= endblock | |||||
= block body | |||||
<div id="message"> | |||||
<span class="c1">puts</span | |||||
><span class="c3">(</span><span class=c2>"</span | |||||
><span id="error-num">404</span><span class=c2>"</span><span class=c3 | |||||
>)</span><span class="c3">;</span> | |||||
</div> | |||||
= endblock |
@@ -16,8 +16,8 @@ | |||||
<meta name="keywords" content="source code language search engine"/> | <meta name="keywords" content="source code language search engine"/> | ||||
<meta name="author" content="Benjamin Attal Ben Kurtovic Severyn Kozak"/> | <meta name="author" content="Benjamin Attal Ben Kurtovic Severyn Kozak"/> | ||||
<link rel="shortcut icon" href="static/img/favicon.ico"> | |||||
{{ assets.tag("main.css") }} | {{ assets.tag("main.css") }} | ||||
{{ assets.tag("main.js") }} | |||||
= block head | = block head | ||||
= endblock | = endblock | ||||