Skip to content

Commit

Permalink
designed for humanity
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Nov 17, 2020
1 parent 266e3f6 commit 2fa55ba
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/routes.py
Expand Up @@ -19,6 +19,10 @@ def index():
return render_template("index.html",
collections=Collection.query.all())

@app.route('/favicon.ico')
def favicon_ico():
return redirect("/static/favicon.ico")

@app.route('/.json')
def index_json():
s = lambda thing : thing.serialize()
Expand Down Expand Up @@ -154,7 +158,7 @@ def piece(username, collection_slug, piece_slug):
piece = collection.pieces.filter_by(slug=piece_slug).first()
if piece is None:
return render_404()
return render_template("_piece.html",
return render_template("piece.html",
copyright_holder=ch,
collection=collection,
piece=piece)
Expand Down
3 changes: 3 additions & 0 deletions app/static/cc0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/static/favicon.ico
Git LFS file not shown
2 changes: 2 additions & 0 deletions app/templates/base.html
@@ -1,5 +1,7 @@
<!DOCTYPE html>
<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>
Expand Down
34 changes: 34 additions & 0 deletions app/templates/piece.html
@@ -0,0 +1,34 @@
{% extends "base.html" %}
{% block head %}
<meta property="og:title" content="title">
<meta property="og:url" content="https://cc0.snoot.club/{{url_for('piece', username=copyright_holder.username, collection_slug=collection.slug, piece_slug=piece.slug)}}">
{% if piece.type.startswith("audio/") %}
<meta property="og:type" content="audio">
<meta property="og:audio" content="{{piece.url}}">
<meta property="og:audio:title" content="" />
<meta property="og:audio:artist" content="{{copyright_holder.legal_name}}" />
<meta property="og:audio:type" content="{{piece.type}}" />
<meta property="og:image" content="https://cc0.snoot.club/static/cc0.png" />
<meta property="og:image:alt" content="cc0 logo">
{% elif piece.type.startswith("image/") %}
<meta property="og:type" content="audio">
<meta property="og:image" content="{{piece.url}}">
<meta property="og:image:secure_url" content="{{piece.url}}">
<meta property="og:image:type" content="{{piece.type}}">
<meta property="og:image:alt" content="{{piece.description}}">
{% elif piece.type.startswith("video/") %}
<meta property="og:type" content="video">
<meta property="og:video" content="{{piece.url}}">
<meta property="og:video:title" content="" />
<meta property="og:video:artist" content="{{copyright_holder.legal_name}}" />
<meta property="og:video:type" content="{{piece.type}}" />
<meta property="og:image" content="https://cc0.snoot.club/static/cc0.png" />
<meta property="og:image:alt" content="cc0 logo">
{% endif %}
<meta name="author" content="{{copyright_holder.legal_name}}">
<meta name="description" content="「{{piece.name}}」 — {{piece.description}}">
<meta name="twitter:title" content="{{piece.name}} — {{piece.description}}">
{% endblock %}
{% block content %}
{% include '_piece.html' %}
{% endblock %}

0 comments on commit 2fa55ba

Please sign in to comment.