Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mastodon comments feature. Fixes #157 #158

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions www/assets/css/comments.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/**
* ╭───────────────────────────────────────────────────────────────╮
* │ Comments │
* ╰───────────────────────────────────────────────────────────────╯
**/

#comments-wrapper {
margin: 1.5em 0;
padding: 0 var(25px);
}

.comment {
display: grid;
column-gap: 1rem;
grid-template-areas: "avatar name" "avatar time" "avatar post" "...... interactions";
grid-template-columns: min-content;
justify-items: start;
margin: 0 auto 0 -1em;
padding: .5em;
}

.comment.comment-reply {
margin: 0 auto 0 1em;
}

.comment .avatar-link {
grid-area: avatar;
height: 4rem;
position: relative;
width: 4rem;
}

.comment .avatar-link .avatar {
height: 100%;
width: 100%;
}

.comment .author {
align-items: center;
display: flex;
font-weight: 700;
gap: .5em;
grid-area: name;
}

.comment .author .instance {
background-color: var(--bg-accent);
color: var(--fg-accent);
border-radius: 9999px;
font-size: smaller;
font-weight: 400;
padding: .25em .75em;
}

.comment .author .instance:hover {
opacity: .8;
text-decoration: none;
}

.comment time {
grid-area: time;
line-height: 3.5rem;
}

.comment main {
grid-area: post;
}

.comment main p:first-child {
margin-top: .25em;
}

.comment main p:last-child {
margin-bottom: 0;
}

.comment footer {
grid-area: interactions;
border: none;
margin-top: 1em;
}

.comment footer .faves {
color: inheritE
}

.comment footer .faves:hover {
opacity: .8;
text-decoration: none;
}

.comment footer .faves::before {
color: red;
content: "♥";
font-size: 1rem;
margin-inline-end: .25em;
}

.comment .emoji {
display: inline;
height: 1.25em;
vertical-align: middle;
width: 1.25em;
}

.comment .invisible {
display: none;
}

.comment .ellipsis::after {
content: "…";
}
98 changes: 1 addition & 97 deletions www/assets/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -377,100 +377,4 @@ code { /* character, digrams, trigrams */
header + nav li:has(.active) a.active {
color: var(--fg-banner);
}
}


/**
* ╭───────────────────────────────────────────────────────────────╮
* │ Comments │
* ╰───────────────────────────────────────────────────────────────╯
**/

section#comments #comments-wrapper {
margin:1.5em 0;
padding:0 var(25px);
}
section#comments .comment {
display:grid;
column-gap:1rem;
grid-template-areas:"avatar name" "avatar time" "avatar post" "...... interactions";
grid-template-columns:min-content;
justify-items:start;
margin:0 auto 0 -1em;
padding:.5em;
}
section#comments .comment.comment-reply {
margin:0 auto 0 1em;
}
section#comments .comment .avatar-link {
grid-area:avatar;
height:4rem;
position:relative;
width:4rem;
}
section#comments .comment .avatar-link .avatar {
height:100%;
width:100%;
}
section#comments .comment .author {
align-items:center;
display:flex;
font-weight:700;
gap:.5em;
grid-area:name;
}
section#comments .comment .author .instance {
background-color:var(--bg-accent);
color:var(--fg-accent);
border-radius:9999px;
font-size:smaller;
font-weight:400;
padding:.25em .75em;
}
section#comments .comment .author .instance:hover {
opacity:.8;
text-decoration:none;
}
section#comments .comment time {
grid-area:time;
line-height:3.5rem;
}
section#comments .comment main {
grid-area:post;
}
section#comments .comment main p:first-child {
margin-top:.25em;
}
section#comments .comment main p:last-child {
margin-bottom:0;
}
section#comments .comment footer {
grid-area:interactions;
border: none;
margin-top: 1em;
}
section#comments .comment footer .faves {
color:inheritE
}
section#comments .comment footer .faves:hover {
opacity:.8;
text-decoration:none;
}
section#comments .comment footer .faves::before {
color:red;
content:"♥";
font-size:1rem;
margin-inline-end:.25em;
}
section#comments .comment .emoji {
display:inline;
height:1.25em;
vertical-align:middle;
width:1.25em;
}
section#comments .comment .invisible {
display:none;
}
section#comments .comment .ellipsis::after {
content:"…";
}
}
3 changes: 0 additions & 3 deletions www/content/articles/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
title = "Articles"
outputs = ["html", "rss"]
footer = "[Flux RSS](index.xml)"

[params]
jsModules = ["/js/purify.min.js"]
+++
4 changes: 4 additions & 0 deletions www/content/articles/bienvenue.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ title = "Bienvenue chez les Ergonautes !"
date = 2024-03-18T22:01:23+01:00
author = "nuclear_squid"
tags = ["communauté"]
[comments]
host = "mastodon.social"
username = "fabi1cazenave"
id = 112124416010685631
+++

Après plus de quatre ans de travail et avec une version 1.0 en approche, il
Expand Down
Loading