Compare commits
No commits in common. "1d98a6fdcac7b8c57468286268265733fb90d637" and "84e40b837aa3632b535d92cd8456e9d74c1372b9" have entirely different histories.
1d98a6fdca
...
84e40b837a
10 changed files with 32 additions and 77 deletions
|
|
@ -6,10 +6,8 @@ input[type="text"] {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
outline: none;
|
outline: none;
|
||||||
color: var(--fg-3);
|
color: var(--fg-3);
|
||||||
background-color: var(--bg-2);
|
background-color: var(--bg-1);
|
||||||
box-shadow: var(--shadow-sm);
|
box-shadow: var(--shadow-sm);
|
||||||
|
|
||||||
transition: background-color .1s ease-out, color .1s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogpost {
|
#blogpost {
|
||||||
|
|
@ -17,10 +15,10 @@ input[type="text"] {
|
||||||
padding: 1.5em;
|
padding: 1.5em;
|
||||||
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background-color: var(--bg-1);
|
background-color: var(--bg-2);
|
||||||
box-shadow: var(--shadow-lg);
|
box-shadow: var(--shadow-lg);
|
||||||
|
|
||||||
transition: background-color .1s ease-out, color .1s ease-out;
|
transition: background .1s ease-out, color .1s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogpost label {
|
#blogpost label {
|
||||||
|
|
@ -58,8 +56,7 @@ input[type="text"] {
|
||||||
color: var(--fg-3);
|
color: var(--fg-3);
|
||||||
outline: none;
|
outline: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transition: background .1s ease-out, border-color .1s ease-out;
|
||||||
transition: background-color .1s ease-out, color .1s ease-out, border-color .1s ease-out;
|
|
||||||
|
|
||||||
/*position: relative; outline: none;*/
|
/*position: relative; outline: none;*/
|
||||||
white-space: pre-wrap; overflow-wrap: break-word;
|
white-space: pre-wrap; overflow-wrap: break-word;
|
||||||
|
|
@ -81,11 +78,9 @@ input[type="text"] {
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: none;
|
border: none;
|
||||||
background-color: var(--bg-2);
|
background-color: var(--bg-1);
|
||||||
color: var(--fg-3);
|
color: var(--fg-3);
|
||||||
box-shadow: var(--shadow-sm);
|
box-shadow: var(--shadow-sm);
|
||||||
|
|
||||||
transition: background-color .1s ease-out, color .1s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogpost textarea {
|
#blogpost textarea {
|
||||||
|
|
@ -95,13 +90,11 @@ input[type="text"] {
|
||||||
display: block;
|
display: block;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--bg-2);
|
background-color: var(--bg-1);
|
||||||
color: var(--fg-3);
|
color: var(--fg-3);
|
||||||
box-shadow: var(--shadow-md);
|
box-shadow: var(--shadow-md);
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
transition: background-color .1s ease-out, color .1s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogpost #description {
|
#blogpost #description {
|
||||||
|
|
@ -114,10 +107,8 @@ input[type="text"] {
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 10em;
|
border-radius: 10em;
|
||||||
color: var(--fg-3);
|
color: var(--fg-3);
|
||||||
background-color: var(--bg-2);
|
background-color: var(--bg-1);
|
||||||
box-shadow: var(--shadow-sm);
|
box-shadow: var(--shadow-sm);
|
||||||
|
|
||||||
transition: background-color .1s ease-out, color .1s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogpost .social-post-details {
|
#blogpost .social-post-details {
|
||||||
|
|
@ -129,12 +120,3 @@ input[type="text"] {
|
||||||
#blogpost .blog-actions {
|
#blogpost .blog-actions {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
input[type="text"],
|
|
||||||
#blogpost #publish-date,
|
|
||||||
#blogpost textarea,
|
|
||||||
#blogpost select {
|
|
||||||
background-color: var(--bg-0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
This action is <strong>irreversible</strong>.
|
This action is <strong>irreversible</strong>.
|
||||||
You will be prompted to confirm this decision.
|
You will be prompted to confirm this decision.
|
||||||
</p>
|
</p>
|
||||||
<button class="delete" id="delete">Delete Post</button>
|
<button class="delete" id="delete">Delete Release</button>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ func GetBlogPost(db *sqlx.DB, id string) (*model.BlogPost, error) {
|
||||||
if strings.Contains(err.Error(), "no rows") { return nil, nil }
|
if strings.Contains(err.Error(), "no rows") { return nil, nil }
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
|
||||||
|
|
||||||
blueskyActor := sql.NullString{}
|
blueskyActor := sql.NullString{}
|
||||||
blueskyRecord := sql.NullString{}
|
blueskyRecord := sql.NullString{}
|
||||||
|
|
@ -85,7 +84,6 @@ func GetBlogPosts(db *sqlx.DB, onlyVisible bool, limit int, offset int) ([]*mode
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
blog := model.BlogPost{}
|
blog := model.BlogPost{}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
const BSKY_API_BASE = "https://public.api.bsky.app"
|
const BSKY_API_BASE = "https://public.api.bsky.app"
|
||||||
|
|
||||||
func FetchThreadViewPost(app *model.AppState, actorID string, recordID string) (*model.ThreadViewPost, error) {
|
func FetchThreadViewPost(actorID string, recordID string) (*model.ThreadViewPost, error) {
|
||||||
uri := fmt.Sprintf("at://%s/app.bsky.feed.post/%s", actorID, recordID)
|
uri := fmt.Sprintf("at://%s/app.bsky.feed.post/%s", actorID, recordID)
|
||||||
|
|
||||||
req, err := http.NewRequest(
|
req, err := http.NewRequest(
|
||||||
|
|
@ -24,7 +24,7 @@ func FetchThreadViewPost(app *model.AppState, actorID string, recordID string) (
|
||||||
req.URL.RawQuery = url.Values{
|
req.URL.RawQuery = url.Values{
|
||||||
"uri": { uri },
|
"uri": { uri },
|
||||||
}.Encode()
|
}.Encode()
|
||||||
req.Header.Set("User-Agent", fmt.Sprintf("ari melody [%s]", app.Config.BaseUrl))
|
req.Header.Set("User-Agent", "ari melody [https://arimelody.me]")
|
||||||
req.Header.Set("Accept", "application/json")
|
req.Header.Set("Accept", "application/json")
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,6 @@ func GetReleaseCredits(db *sqlx.DB, releaseID string) ([]*model.Credit, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
|
||||||
|
|
||||||
var credits []*model.Credit
|
var credits []*model.Credit
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,7 @@ func (b *BlogPost) GetMonth() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BlogPost) PrintDate() string {
|
func (b *BlogPost) PrintDate() string {
|
||||||
return b.PublishDate.Format("02 January 2006, 15:04")
|
return b.PublishDate.Format("2 January 2006, 15:04")
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BlogPost) PrintShortDate() string {
|
|
||||||
return b.PublishDate.Format("2 Jan 2006")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BlogPost) TextPublishDate() string {
|
func (b *BlogPost) TextPublishDate() string {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
width: min(calc(100% - 4rem), 800px);
|
width: min(calc(100% - 4rem), 1200px);
|
||||||
margin: 0 auto 1rem auto;
|
margin: 0 auto 1rem auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,26 +70,24 @@ main {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog p:hover,
|
article#blog p:hover,
|
||||||
.comment p:hover {
|
.comment p:hover {
|
||||||
background: inherit;
|
background: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog {
|
article#blog {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog h1 {
|
article#blog h1 {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-size: 1.8em;
|
font-size: 1.8em;
|
||||||
}
|
}
|
||||||
#blog h2::before { content: "## " }
|
|
||||||
#blog h3::before { content: "### " }
|
|
||||||
|
|
||||||
.blog-author {
|
.blog-author {
|
||||||
margin: .2em 0;
|
margin: .2em 0;
|
||||||
}
|
}
|
||||||
#blog .blog-author img {
|
article#blog .blog-author img {
|
||||||
width: 1.3em;
|
width: 1.3em;
|
||||||
height: 1.3em;
|
height: 1.3em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -106,11 +104,11 @@ main {
|
||||||
opacity: .75;
|
opacity: .75;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog {
|
article#blog {
|
||||||
font-family: 'Lora', serif;
|
font-family: 'Lora', serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog header {
|
article#blog header {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: auto;
|
width: auto;
|
||||||
font-family: 'Monaspace Argon', monospace;
|
font-family: 'Monaspace Argon', monospace;
|
||||||
|
|
@ -119,20 +117,20 @@ main {
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog p {
|
article#blog p {
|
||||||
line-height: 1.25em;
|
line-height: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog p.no-content {
|
article#blog p.no-content {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
opacity: .66;
|
opacity: .66;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog sub {
|
article#blog sub {
|
||||||
opacity: .75;
|
opacity: .75;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog pre {
|
article#blog pre {
|
||||||
max-height: 15em;
|
max-height: 15em;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
|
|
@ -142,7 +140,7 @@ main {
|
||||||
background: var(--background-alt);
|
background: var(--background-alt);
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog p code {
|
article#blog p code {
|
||||||
padding: .2em .3em;
|
padding: .2em .3em;
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
border: 1px solid #8884;
|
border: 1px solid #8884;
|
||||||
|
|
@ -150,30 +148,20 @@ main {
|
||||||
background: var(--background-alt);
|
background: var(--background-alt);
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog blockquote {
|
article#blog blockquote {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
padding: 0 0 0 1em;
|
padding: 0 0 0 1em;
|
||||||
border-left: .2em solid #8888;
|
border-left: .2em solid #8888;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog img {
|
article#blog img {
|
||||||
max-height: 50%;
|
max-height: 50%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog figure {
|
article#blog i.end-mark {
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#blog figure.quote {
|
|
||||||
border-left: 4px solid color-mix(in srgb, var(--on-background), transparent 75%);
|
|
||||||
color: color-mix(in srgb, var(--on-background), transparent 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#blog i.end-mark {
|
|
||||||
width: 1.2em;
|
width: 1.2em;
|
||||||
height: 1.2em;
|
height: 1.2em;
|
||||||
margin-top: -.2em;
|
margin-top: -.2em;
|
||||||
|
|
@ -248,7 +236,7 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-callout {
|
.comment-callout {
|
||||||
margin: 0 0 0 .5em;
|
margin: 0 0 0 1em;
|
||||||
}
|
}
|
||||||
.comment-callout:hover {
|
.comment-callout:hover {
|
||||||
background: none;
|
background: none;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<h3 class="blog-title"><a href="/blog/{{.ID}}">{{.Title}}</a></h3>
|
<h3 class="blog-title"><a href="/blog/{{.ID}}">{{.Title}}</a></h3>
|
||||||
<p class="blog-meta">
|
<p class="blog-meta">
|
||||||
<span class="blog-author"><img src="/img/favicon.png" alt="" width="32" height="32"/> {{.Author.DisplayName}}</span>
|
<span class="blog-author"><img src="/img/favicon.png" alt="" width="32" height="32"/> {{.Author.DisplayName}}</span>
|
||||||
<span class="blog-date">• {{.PrintShortDate}}</span>
|
<span class="blog-date">• {{.PrintDate}}</span>
|
||||||
</p>
|
</p>
|
||||||
{{if ne .Description ""}}
|
{{if ne .Description ""}}
|
||||||
<p class="blog-description">{{.Description}}</p>
|
<p class="blog-description">{{.Description}}</p>
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h1 class="typeout"># {{.Title}}</h1>
|
<h1 class="typeout"># {{.Title}}</h1>
|
||||||
<p class="blog-author">by <a href="/blog?author={{.Author.DisplayName}}">{{.Author.DisplayName}} <img src="/img/favicon.png" alt="" aria-hidden="true" width="32" height="32"/></a></p>
|
<p class="blog-author">by <a href="/blog?author={{.Author.DisplayName}}">{{.Author.DisplayName}} <img src="/img/favicon.png" alt="" aria-hidden="true" width="32" height="32"/></a></p>
|
||||||
<p class="blog-date">Published {{.PrintDate}}</p>
|
<p class="blog-date">posted {{.PrintDate}}</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -110,7 +110,6 @@
|
||||||
</div>
|
</div>
|
||||||
{{.Likes}}
|
{{.Likes}}
|
||||||
</a>
|
</a>
|
||||||
<!--
|
|
||||||
<a href="{{.BlueskyURL}}" class="button boosts" aria-label="{{.Boosts}} boosts">
|
<a href="{{.BlueskyURL}}" class="button boosts" aria-label="{{.Boosts}} boosts">
|
||||||
<div class="dark-only">
|
<div class="dark-only">
|
||||||
<img src="/img/blog/boost-dark.svg" alt="" width="32" height="32">
|
<img src="/img/blog/boost-dark.svg" alt="" width="32" height="32">
|
||||||
|
|
@ -120,7 +119,6 @@
|
||||||
</div>
|
</div>
|
||||||
{{.Boosts}}
|
{{.Boosts}}
|
||||||
</a>
|
</a>
|
||||||
-->
|
|
||||||
|
|
||||||
<p class="comment-callout">
|
<p class="comment-callout">
|
||||||
join the conversation on
|
join the conversation on
|
||||||
|
|
|
||||||
10
view/blog.go
10
view/blog.go
|
|
@ -141,17 +141,11 @@ func ServeBlogPost(app *model.AppState, blogPostID string) http.Handler {
|
||||||
var blueskyURL string
|
var blueskyURL string
|
||||||
var blueskyPost *model.ThreadViewPost
|
var blueskyPost *model.ThreadViewPost
|
||||||
if blog.Bluesky != nil {
|
if blog.Bluesky != nil {
|
||||||
blueskyPost, err = controller.FetchThreadViewPost(app, blog.Bluesky.ActorDID, blog.Bluesky.RecordID)
|
blueskyPost, err = controller.FetchThreadViewPost(blog.Bluesky.ActorDID, blog.Bluesky.RecordID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "WARN: Failed to fetch blog post Bluesky thread: %v\n", err)
|
fmt.Fprintf(os.Stderr, "WARN: Failed to fetch blog post Bluesky thread: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
replies := []*model.ThreadViewPost{}
|
comments = append(comments, blueskyPost.Replies...)
|
||||||
for _, reply := range blueskyPost.Replies {
|
|
||||||
if reply.Post.Author.DID != blog.Bluesky.ActorDID {
|
|
||||||
replies = append(replies, reply)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comments = append(comments, replies...)
|
|
||||||
likeCount += blueskyPost.Post.LikeCount
|
likeCount += blueskyPost.Post.LikeCount
|
||||||
boostCount += blueskyPost.Post.RepostCount
|
boostCount += blueskyPost.Post.RepostCount
|
||||||
blueskyURL = fmt.Sprintf("https://bsky.app/profile/%s/post/%s", blueskyPost.Post.Author.Handle, blog.Bluesky.RecordID)
|
blueskyURL = fmt.Sprintf("https://bsky.app/profile/%s/post/%s", blueskyPost.Post.Author.Handle, blog.Bluesky.RecordID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue