Make the article datetime always a link to the article permalink. Issue #1655

This commit is contained in:
Maurice Parker 2020-01-19 17:28:06 -07:00
parent 53ba0bc9ac
commit f15ade5ebb
2 changed files with 5 additions and 11 deletions

View File

@ -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 its a different link from the titles 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 ""

View File

@ -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;
} }