Name the author ahead of the feed on issue index lines
Every list of articles now reads "Author · Feed · Publication · N min": the signed-in issue page, the public issue page, the RSS feed and the EPUB's In This Issue page. `author_label` drops an author that is empty or only repeats the feed's title, as a dozen personal blogs do. Article pages keep their own byline. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VXYGBPoHZSDSfE5WcJ9bvj
This commit is contained in:
1 parent
f2a44507d4
commit
1a009a2113
6 files changed
+46
-5
No files matched your search
@@ -876,6 +876,7 @@ struct FullEntry {
|
||||
title: String,
|
||||
href: String,
|
||||
dashboard_href: String,
|
||||
author: Option<String>,
|
||||
source: Source,
|
||||
reading_minutes: i64,
|
||||
is_lead: bool,
|
||||
@@ -1021,6 +1022,7 @@ pub async fn render_full(
|
||||
title: pick.article.title.clone(),
|
||||
href: article_href(date, pick.article.id),
|
||||
dashboard_href: format!("/dashboard/articles/{}", pick.article.id),
|
||||
author: pick.article.author_label(),
|
||||
source: Source::new(&pick.article, &config, is_admin),
|
||||
reading_minutes: pick.article.reading_minutes(),
|
||||
is_lead: pick.is_lead,
|
||||
@@ -1946,6 +1948,13 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn signed_in_full_issue_article_world_and_behind_render_private_content() {
|
||||
let (_dir, db, source) = seeded_issue(true).await;
|
||||
let matching_author = &source.lineup.picks[1].article;
|
||||
sqlx::query("UPDATE articles SET author = ? WHERE id = ?")
|
||||
.bind(format!(" {} ", matching_author.feed_title.to_lowercase()))
|
||||
.bind(matching_author.id)
|
||||
.execute(db.pool())
|
||||
.await
|
||||
.unwrap();
|
||||
crate::web::users::add(&db, "reader", "correct horse battery", false)
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -1993,6 +2002,8 @@ mod tests {
|
||||
assert!(issue.contains("A short abstract for the second piece"));
|
||||
assert!(issue.contains("Why it"));
|
||||
assert!(issue.contains("Interests: Filesystems, Rust"));
|
||||
assert!(issue.contains("A. Writer · Example Feed"));
|
||||
assert!(!issue.contains("example feed · Example Feed"));
|
||||
assert!(issue.contains("World Briefing"));
|
||||
assert!(issue.contains("Behind the paper"));
|
||||
assert!(!issue.contains("Was this a good pick?"));
|
||||
|
||||
Reference in new issue
Block a user