chore: ignore threads/ blueprint
This commit is contained in:
parent
bc46633af4
commit
2a04803d41
2 changed files with 1 additions and 439 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -4,8 +4,7 @@ config.json
|
||||||
*.sock
|
*.sock
|
||||||
|
|
||||||
# blueprints
|
# blueprints
|
||||||
threads.py
|
threads/
|
||||||
templates/threads.html
|
|
||||||
|
|
||||||
# Temp files
|
# Temp files
|
||||||
*~
|
*~
|
||||||
|
|
|
@ -1,437 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>{{ app.title }}</title>
|
|
||||||
<meta name="theme-color" content="#3054bf">
|
|
||||||
{% if threads|length == 1 %}
|
|
||||||
<meta name="description" content="{{ threads[0].summary }}" />
|
|
||||||
<meta property="og:description" content="{{ threads[0].summary }}" />
|
|
||||||
{% else %}
|
|
||||||
<meta name="description" content="{{ app.description }}" />
|
|
||||||
<meta property="og:description" content="{{ app.description }}" />
|
|
||||||
{% endif %}
|
|
||||||
<meta name="author" content="{{ attribution.owner }}" />
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
<meta property="og:site_name" content="{{ app.site_name }}" />
|
|
||||||
<meta property="og:title" content="{{ app.title }}" />
|
|
||||||
|
|
||||||
<script type="module">
|
|
||||||
import TimeAgo from 'https://esm.sh/v135/@github/relative-time-element@4.4.0'
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://webcomponent.io/reset.css" />
|
|
||||||
<style>
|
|
||||||
html {
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
font-family: system-ui, sans-serif;
|
|
||||||
max-width: 600px;
|
|
||||||
margin: 0 auto;
|
|
||||||
color: #232323;
|
|
||||||
}
|
|
||||||
header, footer, main {
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
header, footer {
|
|
||||||
background: linear-gradient(45deg, #3054bf, #416fff);
|
|
||||||
color: white;
|
|
||||||
& a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
main.home {
|
|
||||||
& .back {
|
|
||||||
display: none
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
main.thread {
|
|
||||||
& li:not(:last-of-type) .card_avatar::after {
|
|
||||||
content: " ";
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
border-right: 2px solid rgba(34, 34, 34, 0.15);
|
|
||||||
width: 26px;
|
|
||||||
margin-top: -8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card_avatar img {
|
|
||||||
border: 2px solid rgba(197, 209, 222, 0.15);
|
|
||||||
border-radius: 50%;
|
|
||||||
display: inline;
|
|
||||||
width: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
margin-left: -40px;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 55px auto;
|
|
||||||
gap: 5px;
|
|
||||||
padding-top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card_content {
|
|
||||||
|
|
||||||
& .invisible {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .emoji {
|
|
||||||
display: inline;
|
|
||||||
height: calc(1rem + 6px);
|
|
||||||
margin-bottom: -4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .ellipsis::after {
|
|
||||||
content: '...'
|
|
||||||
}
|
|
||||||
|
|
||||||
& .body {
|
|
||||||
|
|
||||||
& code {
|
|
||||||
background: rgb(245, 242, 240);
|
|
||||||
padding: 0.25em 0.3em;
|
|
||||||
border-radius: 5px;
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
& a:has(.link_card) {
|
|
||||||
text-decoration: none
|
|
||||||
}
|
|
||||||
|
|
||||||
& .media, & .link_card {
|
|
||||||
border: 1px solid rgba(34, 34, 34, 0.15);
|
|
||||||
border-radius: 5px;
|
|
||||||
box-shadow: 5px 25px 10px -25px rgba(34, 34, 34, 0.15);
|
|
||||||
max-width: 100%;
|
|
||||||
margin: 15px 0 1em;
|
|
||||||
object-fit: contain;
|
|
||||||
height: auto;
|
|
||||||
text-decoration: none;
|
|
||||||
text-wrap: balance;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .media:hover, & .link_card:hover {
|
|
||||||
color: blue;
|
|
||||||
text-decoration-color: blue;
|
|
||||||
border-color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
& p {
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& .heading {
|
|
||||||
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: auto auto;
|
|
||||||
gap: 5px;
|
|
||||||
|
|
||||||
& .right_menu {
|
|
||||||
padding-top: 5px;
|
|
||||||
font-size: small;
|
|
||||||
text-align: right;
|
|
||||||
color: #888;
|
|
||||||
|
|
||||||
& a{
|
|
||||||
color: #888;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& .author a {
|
|
||||||
display: block;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #232323;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
& .meta {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
|
|
||||||
& a {
|
|
||||||
font-size: small;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
& a:hover {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
& .action {
|
|
||||||
color: blue;
|
|
||||||
margin: 1em 0;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .link_card {
|
|
||||||
color: #555;
|
|
||||||
text-decoration: underline;
|
|
||||||
text-decoration-color: #888;
|
|
||||||
|
|
||||||
& strong, & small {
|
|
||||||
text-decoration-thickness: 1px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
html, body {
|
|
||||||
background: #212529;
|
|
||||||
color: #f8f9fa;
|
|
||||||
|
|
||||||
}
|
|
||||||
main a {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
|
|
||||||
main.thread {
|
|
||||||
& li:not(:last-of-type) .card_avatar::after {
|
|
||||||
border-right: 2px solid rgba(197, 209, 222, 0.15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.card_content {
|
|
||||||
& .action {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
& .heading .author a {
|
|
||||||
color: #f8f9fa;
|
|
||||||
}
|
|
||||||
& .heading .right_menu a:hover {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
& .body {
|
|
||||||
code {
|
|
||||||
background: rgb(45, 51, 59);
|
|
||||||
color: rgb(197, 209, 222);
|
|
||||||
}
|
|
||||||
& .media, & .link_card {
|
|
||||||
border: 1px solid rgba(197, 209, 222, 0.15);
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
& .media:hover, & .link_card:hover {
|
|
||||||
color: orange;
|
|
||||||
text-decoration-color: orange;
|
|
||||||
border-color: orange;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<a id="top"></a>
|
|
||||||
<header>
|
|
||||||
<nav><a href="/">Go home</a></nav>
|
|
||||||
<h1>{{ app.title }}</h1>
|
|
||||||
<p>{{ app.description }}</p>
|
|
||||||
</header>
|
|
||||||
<main class={{ "thread" if threads|length == 1 else "home" }}>
|
|
||||||
<div class="back">
|
|
||||||
<a href="{{url_for('threads.home')}}">Back</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{% for thread in threads %}
|
|
||||||
<li class="card">
|
|
||||||
<div class="card_avatar">
|
|
||||||
{% if thread.account.avatar is defined %}
|
|
||||||
<a href="{{ thread.account.avatar }}">
|
|
||||||
<img class="avatar" src="{{ thread.account.avatar }}"
|
|
||||||
alt="avatar of {{ thread.account.display_name }}"
|
|
||||||
title="avatar of {{ thread.account.display_name }}" />
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card_content" id="{{ thread.id }}">
|
|
||||||
<div class="heading">
|
|
||||||
<h3 class="author">
|
|
||||||
<a rel="author" href="{{thread.account.url}}">{{thread.account.display_name | safe}}</a>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="right_menu">
|
|
||||||
<a href="{{ thread.url }}" title="{{ thread.created_at }}">
|
|
||||||
<relative-time datetime="{{ thread.created_at }}" precision="day">{{ thread.created_at }}</relative-time>
|
|
||||||
</a> ·
|
|
||||||
<a href="{{ url_for('threads.thread', id=thread['id']) + '#' + thread['id'] }}">Anchor</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="body">
|
|
||||||
{{thread.content | safe}}
|
|
||||||
{% if thread.descendants is defined %}
|
|
||||||
{% for media in thread.media_attachments %}
|
|
||||||
{% if media.type == 'image'%}
|
|
||||||
<a href="{{ media.url }}">
|
|
||||||
<img
|
|
||||||
class="media"
|
|
||||||
width="{{ media.meta.small.width }}"
|
|
||||||
height="{{ media.meta.small.height }}"
|
|
||||||
src="{{media.preview_url}}"
|
|
||||||
alt="{{ media.description or 'media attachment' }}"
|
|
||||||
title="{{ media.description or 'media attachment' }}"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
{% elif media.type == 'gifv' %}
|
|
||||||
<video
|
|
||||||
class="media"
|
|
||||||
controls
|
|
||||||
autoplay="autoplay"
|
|
||||||
muted
|
|
||||||
loop
|
|
||||||
alt="{{ media.description or 'media attachment' }}"
|
|
||||||
title="{{ media.description or 'media attachment' }}"
|
|
||||||
>
|
|
||||||
<source src="{{media.url}}" type="video/mp4" />
|
|
||||||
Your browser does not support the video tag.
|
|
||||||
</video>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
{% if thread.media_attachments|length <= 0 and thread.card %}
|
|
||||||
<a href="{{ thread.card.url }}">
|
|
||||||
<div class="link_card">
|
|
||||||
<small>
|
|
||||||
{{ thread.card.provider_name or
|
|
||||||
thread.card.provider_url }}
|
|
||||||
</small>
|
|
||||||
<strong>{{ thread.card.title }}</strong>
|
|
||||||
<small>{{thread.card.description}}</small>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if thread.descendants is defined %}
|
|
||||||
</li>
|
|
||||||
{% for descendant in thread.descendants %}
|
|
||||||
<li class="card descendant">
|
|
||||||
<div class="card_avatar">
|
|
||||||
{% if descendant.account.avatar is defined %}
|
|
||||||
<a href="{{ descendant.account.avatar }}">
|
|
||||||
<img class="avatar" src="{{ descendant.account.avatar }}"
|
|
||||||
alt="avatar of {{ descendant.account.display_name }}"
|
|
||||||
title="avatar of {{ descendant.account.display_name }}" />
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card_content" id="{{ descendant.id }}">
|
|
||||||
<div class="heading">
|
|
||||||
<h3 class="author">
|
|
||||||
<a rel="author" href="{{descendant.account.url}}"
|
|
||||||
>{{descendant.account.display_name | safe}}</a
|
|
||||||
>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="right_menu">
|
|
||||||
<a href="{{ descendant.url }}" title="{{ descendant.created_at }}">
|
|
||||||
<relative-time datetime="{{ descendant.created_at }}" precision="day">{{ descendant.created_at }}</relative-time>
|
|
||||||
</a> ·
|
|
||||||
<a href="{{ url_for('threads.thread', id=thread['id']) + '#' + descendant['id'] }}">Anchor</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="body">
|
|
||||||
{{ descendant.content | safe }}
|
|
||||||
{% for media in descendant.media_attachments %}
|
|
||||||
{% if media.type == 'image'%}
|
|
||||||
<a href="{{ media.url }}">
|
|
||||||
<img
|
|
||||||
class="media"
|
|
||||||
width="{{ media.meta.small.width }}"
|
|
||||||
height="{{ media.meta.small.height }}"
|
|
||||||
src="{{ media.preview_url}} "
|
|
||||||
alt="{{ media.description or 'media attachment' }}"
|
|
||||||
title="{{ media.description or 'media attachment' }}"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
{% elif media.type == 'gifv' %}
|
|
||||||
<video
|
|
||||||
class="media"
|
|
||||||
controls
|
|
||||||
autoplay="autoplay"
|
|
||||||
muted
|
|
||||||
loop
|
|
||||||
alt="{{ media.description or 'media attachment' }}"
|
|
||||||
title="{{ media.description or 'media attachment' }}"
|
|
||||||
>
|
|
||||||
<source src="{{media.url}}" type="video/mp4" />
|
|
||||||
Your browser does not support the video tag.
|
|
||||||
</video>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{% if descendant.media_attachments|length <= 0 and descendant.card %}
|
|
||||||
<a href="{{ descendant.card.url }}">
|
|
||||||
<div class="link_card">
|
|
||||||
<small>
|
|
||||||
{{ descendant.card.provider_name or
|
|
||||||
descendant.card.provider_url }}
|
|
||||||
</small>
|
|
||||||
<strong>{{ descendant.card.title }}</strong>
|
|
||||||
<small>{{descendant.card.description}}</small>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
<a
|
|
||||||
class="action"
|
|
||||||
href="{{ url_for('threads.thread', id=thread.id) }}"
|
|
||||||
>Read full thread</a
|
|
||||||
>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
<a href="#top">Top</a>
|
|
||||||
</main>
|
|
||||||
<footer>
|
|
||||||
<p>
|
|
||||||
Copyright ©
|
|
||||||
{% if attribution.current_year %}
|
|
||||||
{{ attribution.year}}-{{ attribution.current_year }}
|
|
||||||
{% else %}
|
|
||||||
{{ attribution.year}}
|
|
||||||
{% endif %}
|
|
||||||
{{ attribution.owner }}
|
|
||||||
</p>
|
|
||||||
<p>Powered by <a href="https://ayco.io/sh/threads">/threads</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in a new issue