Compare commits
No commits in common. "0596edc4b2e3e77f3c3f67d898f6d2a3a59fc08f" and "486c9ae641e74f4ac2933febefbaedddfd56cfeb" have entirely different histories.
0596edc4b2
...
486c9ae641
4 changed files with 16 additions and 39 deletions
|
@ -1,19 +0,0 @@
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
document.querySelectorAll('.comment-hover').forEach((/** @type {HTMLDivElement} */ comment) => {
|
|
||||||
/** @type {HTMLLinkElement} */
|
|
||||||
const commentBody = comment.querySelector('a.comment-body');
|
|
||||||
|
|
||||||
comment.querySelectorAll('a').forEach((/** @type {HTMLLinkElement} */ element) => {
|
|
||||||
element.addEventListener('click', event => {
|
|
||||||
event.stopPropagation();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
comment.addEventListener('click', () => {
|
|
||||||
commentBody.click();
|
|
||||||
});
|
|
||||||
|
|
||||||
comment.style.cursor = 'pointer';
|
|
||||||
comment.role = 'link';
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -204,7 +204,7 @@ article.blog {
|
||||||
white-space: break-spaces;
|
white-space: break-spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment .comment-footer {
|
.comment .comment-footer .comment-date {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
|
|
22
view/blog.go
22
view/blog.go
|
@ -16,15 +16,6 @@ import (
|
||||||
"github.com/gomarkdown/markdown/parser"
|
"github.com/gomarkdown/markdown/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlogView struct {
|
|
||||||
*model.Blog
|
|
||||||
Comments []*model.ThreadViewPost
|
|
||||||
Likes int
|
|
||||||
Reposts int
|
|
||||||
BlueskyURL string
|
|
||||||
MastodonURL string
|
|
||||||
}
|
|
||||||
|
|
||||||
var mdRenderer = html.NewRenderer(html.RendererOptions{
|
var mdRenderer = html.NewRenderer(html.RendererOptions{
|
||||||
Flags: html.CommonFlags | html.HrefTargetBlank,
|
Flags: html.CommonFlags | html.HrefTargetBlank,
|
||||||
})
|
})
|
||||||
|
@ -118,11 +109,20 @@ this is `+"`"+`aridoodle`+"`"+`. please take care of her.
|
||||||
comments = append(comments, blueskyPost.Replies...)
|
comments = append(comments, blueskyPost.Replies...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BlogView struct {
|
||||||
|
*model.Blog
|
||||||
|
Comments []*model.ThreadViewPost
|
||||||
|
Likes int
|
||||||
|
Reposts int
|
||||||
|
BlueskyURL string
|
||||||
|
MastodonURL string
|
||||||
|
}
|
||||||
|
|
||||||
err = templates.BlogTemplate.Execute(w, BlogView{
|
err = templates.BlogTemplate.Execute(w, BlogView{
|
||||||
Blog: &blog,
|
Blog: &blog,
|
||||||
Comments: blueskyPost.Replies,
|
Comments: blueskyPost.Replies,
|
||||||
Likes: blueskyPost.Post.LikeCount,
|
Likes: 10,
|
||||||
Reposts: blueskyPost.Post.RepostCount,
|
Reposts: 10,
|
||||||
BlueskyURL: fmt.Sprintf("https://bsky.app/profile/%s/post/%s", blog.BlueskyActorID, blog.BlueskyPostID),
|
BlueskyURL: fmt.Sprintf("https://bsky.app/profile/%s/post/%s", blog.BlueskyActorID, blog.BlueskyPostID),
|
||||||
MastodonURL: "#",
|
MastodonURL: "#",
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,10 +38,8 @@
|
||||||
join the conversation on
|
join the conversation on
|
||||||
<a class="btn bluesky" href="{{.BlueskyURL}}" target="_blank">Bluesky 🦋</a>
|
<a class="btn bluesky" href="{{.BlueskyURL}}" target="_blank">Bluesky 🦋</a>
|
||||||
<!-- TODO: mastodon support -->
|
<!-- TODO: mastodon support -->
|
||||||
<!--
|
or
|
||||||
or
|
<a class="btn mastodon" href="{{.MastodonURL}}" target="_blank">Mastodon 🐘</a>
|
||||||
<a class="btn mastodon" href="{{.MastodonURL}}" target="_blank">Mastodon 🐘</a>
|
|
||||||
-->
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
|
@ -76,10 +74,8 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="comment-footer">
|
<div class="comment-footer">
|
||||||
<span>{{.Post.LikeCount}} like{{if ne .Post.LikeCount 1}}s{{end}}</span>
|
<!-- <span>{{.Post.LikeCount}} likes</span> -->
|
||||||
•
|
<!-- <span>{{.Post.RepostCount}} reposts</span> -->
|
||||||
<span>{{.Post.RepostCount}} repost{{if ne .Post.RepostCount 1}}s{{end}}</span>
|
|
||||||
•
|
|
||||||
<span class="comment-date">{{.Post.Record.CreatedAtPrint}}</span>
|
<span class="comment-date">{{.Post.Record.CreatedAtPrint}}</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue