Skip to content

Commit

Permalink
set title in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Nov 17, 2020
1 parent d11c928 commit e5548bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/routes.py
Expand Up @@ -12,7 +12,7 @@ def render_json(thing):
return Response(stringify_json(thing), mimetype="application/json")

def render_404(thing=""):
return Response(f"404 {thing} not found", status=404)
return Response(f"404 {thing} not found", status=404)

@app.route('/')
def index():
Expand Down Expand Up @@ -133,6 +133,7 @@ def collection(username, slug):
if collection is None:
return render_404("collection")
return render_template("collection.html",
title=collection.name,
copyright_holder=ch,
collection=collection)

Expand Down
5 changes: 1 addition & 4 deletions app/templates/base.html
Expand Up @@ -2,10 +2,7 @@
<meta charset="utf-8">
<link rel="stylesheet" href="/static/style.css">
{% block head %}{% endblock %}
{% if collection %}
<title>{{collection.name}} — public dump</title>
<h1>{{collection.name}}</h1>
{% elif title %}
{% if title %}
<title>{{title}} — public dump</title>
<h1>{{title}}</h1>
{% else %}
Expand Down

0 comments on commit e5548bf

Please sign in to comment.