Make the article datetime always a link to the article permalink. Issue #1655
This commit is contained in:
parent
53ba0bc9ac
commit
f15ade5ebb
|
@ -157,7 +157,7 @@ private extension ArticleRenderer {
|
||||||
let mediumDate = dateString(datePublished, .medium, .short)
|
let mediumDate = dateString(datePublished, .medium, .short)
|
||||||
let shortDate = dateString(datePublished, .short, .short)
|
let shortDate = dateString(datePublished, .short, .short)
|
||||||
|
|
||||||
if dateShouldBeLink() || self.title == "", let permalink = article.url {
|
if let permalink = article.url {
|
||||||
d["date_long"] = longDate.htmlByAddingLink(permalink)
|
d["date_long"] = longDate.htmlByAddingLink(permalink)
|
||||||
d["date_medium"] = mediumDate.htmlByAddingLink(permalink)
|
d["date_medium"] = mediumDate.htmlByAddingLink(permalink)
|
||||||
d["date_short"] = shortDate.htmlByAddingLink(permalink)
|
d["date_short"] = shortDate.htmlByAddingLink(permalink)
|
||||||
|
@ -173,16 +173,6 @@ private extension ArticleRenderer {
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
func dateShouldBeLink() -> Bool {
|
|
||||||
guard let permalink = article?.url else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
guard let preferredLink = article?.preferredLink else { // Title uses preferredLink
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return permalink != preferredLink // Make date a link if it’s a different link from the title’s link
|
|
||||||
}
|
|
||||||
|
|
||||||
func byline() -> String {
|
func byline() -> String {
|
||||||
guard let authors = article?.authors ?? article?.webFeed?.authors, !authors.isEmpty else {
|
guard let authors = article?.authors ?? article?.webFeed?.authors, !authors.isEmpty else {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -116,6 +116,10 @@ body > .systemMessage {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.articleDateline a:link, .articleDateline a:visited {
|
||||||
|
color: var(--article-title-color);
|
||||||
|
}
|
||||||
|
|
||||||
.articleBody {
|
.articleBody {
|
||||||
line-height: 1.6em;
|
line-height: 1.6em;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue