Compare commits
4 Commits
43a3fc1a69
...
63c679d859
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 63c679d859 | |
Shadowfacts | d0663a17e7 | |
Shadowfacts | f007b2d1ca | |
Shadowfacts | 1f28d6263c |
|
@ -130,15 +130,18 @@ export async function signAndSend(activity: Activity, inbox: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sendToFollowers(activity: Create, db: Database) {
|
async function sendToFollowers(activity: Create, db: Database) {
|
||||||
// TODO: only send to unique inboxes
|
db.all("SELECT inbox FROM followers", (err, results) => {
|
||||||
db.each("SELECT inbox FROM followers", (err, result) => {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log("Error getting followers: ", err);
|
console.log("Error getting followers: ", err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const inbox = "https://" + new URL(result.inbox).host + "/inbox";
|
const inboxes = results.map(it => "https://" + new URL(it.inbox).host + "/inbox");
|
||||||
console.log(`Federating ${activity.object.id} to ${inbox}`);
|
// convert to a Set to deduplicate inboxes
|
||||||
signAndSend(activity, inbox);
|
(new Set(inboxes))
|
||||||
|
.forEach(inbox => {
|
||||||
|
console.log(`Federating ${activity.object.id} to ${inbox}`);
|
||||||
|
signAndSend(activity, inbox);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ metadata.layout = "default.html.ejs"
|
||||||
<% for (const post of posts) { %>
|
<% for (const post of posts) { %>
|
||||||
<article itemscope itemtype="https://schema.org/BlogPosting">
|
<article itemscope itemtype="https://schema.org/BlogPosting">
|
||||||
<h2 class="article-title" itemprop="headline">
|
<h2 class="article-title" itemprop="headline">
|
||||||
<%- fancyLink(post.metadata.title, post.metadata.permalink, `itemprop="url mainEntityOfPage"`) %>
|
<a href="<%= post.metadata.permalink %>" itemprop="url mainEntityOfPage">
|
||||||
|
<%= post.metadata.title %>
|
||||||
|
</a>
|
||||||
</h2>
|
</h2>
|
||||||
<%- include("includes/article-meta.html.ejs", { metadata: post.metadata }) %>
|
<%- include("includes/article-meta.html.ejs", { metadata: post.metadata }) %>
|
||||||
<div class="article-content" itemprop="description">
|
<div class="article-content" itemprop="description">
|
||||||
|
|
|
@ -42,6 +42,7 @@ body {
|
||||||
article {
|
article {
|
||||||
margin-bottom: 75px;
|
margin-bottom: 75px;
|
||||||
color: var(--content-text-color);
|
color: var(--content-text-color);
|
||||||
|
border-bottom: 1px solid var(--accent-color);
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
a::before { content: "["; }
|
a::before { content: "["; }
|
||||||
|
@ -81,14 +82,6 @@ article {
|
||||||
color: var(--secondary-ui-text-color);
|
color: var(--secondary-ui-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
width: calc(100% - 2 * 30px); // account for .container padding, don't overflow
|
|
||||||
height: 1px;
|
|
||||||
background-color: var(--accent-color);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-title {
|
.article-title {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
@ -147,26 +140,31 @@ article {
|
||||||
}
|
}
|
||||||
|
|
||||||
#comments-container {
|
#comments-container {
|
||||||
.comments-list {
|
border-bottom: 1px solid var(--accent-color);
|
||||||
margin-top: 0px;
|
padding-bottom: 55px;
|
||||||
padding-left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comment-user-avatar {
|
.comment-user-avatar {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
border-radius: 5px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
border-radius: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-info {
|
@media (min-width: 768px) {
|
||||||
margin-top: 0px;
|
.comments-list {
|
||||||
margin-bottom: 5px;
|
margin-top: 0px;
|
||||||
}
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.comment-children {
|
.comment-info {
|
||||||
margin-left: 50px;
|
margin-top: 0px;
|
||||||
margin-top: 20px;
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-children {
|
||||||
|
margin-left: 60px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,21 +397,16 @@ figure {
|
||||||
|
|
||||||
// Footer
|
// Footer
|
||||||
.site-footer {
|
.site-footer {
|
||||||
padding-top: 20px;
|
margin-top: 75px;
|
||||||
padding-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
background-color: var(--ui-background-color);
|
background-color: var(--ui-background-color);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
> div {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
align-items: flex-start;
|
||||||
align-items: flex-start;
|
flex-wrap: wrap;
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
padding-top: 10px;
|
|
||||||
// border-top: 3px solid var(--accent-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-title {
|
.site-title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -463,6 +456,10 @@ figure {
|
||||||
.pagination {
|
.pagination {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.pagination-link {
|
.pagination-link {
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<p class="article-meta">
|
<p class="article-meta">
|
||||||
<meta itemprop="author" value="Shadowfacts">
|
<div itemprop="author" itemscope="" itemtype="https://schema.org/Person">
|
||||||
|
<meta itemprop="name" content="Shadowfacts">
|
||||||
|
</div>
|
||||||
on
|
on
|
||||||
<span>
|
<span>
|
||||||
<% const formatted = formatDate(metadata.date, "MMM Do, YYYY") %>
|
<% const formatted = formatDate(metadata.date, "MMM Do, YYYY") %>
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="site-footer container">
|
<footer class="site-footer container">
|
||||||
<div>
|
<!-- <div> -->
|
||||||
<div>
|
<div>
|
||||||
<h2 class="site-title">Shadowfacts</h2>
|
<h2 class="site-title">Shadowfacts</h2>
|
||||||
<p class="ui-controls">
|
<p class="ui-controls">
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
<li><%- fancyLink("Mastodon", "https://social.shadowfacts.net/users/shadowfacts", "rel=me") %></li>
|
<li><%- fancyLink("Mastodon", "https://social.shadowfacts.net/users/shadowfacts", "rel=me") %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(() => {
|
(() => {
|
||||||
|
|
Loading…
Reference in New Issue