mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-10 17:02:54 +01:00
Add external_url to article header if the article is a link-blog style article. Fixes #2569
This commit is contained in:
parent
e32c38f327
commit
6398c56511
@ -152,7 +152,19 @@ private extension ArticleRenderer {
|
||||
|
||||
let title = titleOrTitleLink()
|
||||
d["title"] = title
|
||||
|
||||
|
||||
if let externalLink = article.externalURL, externalLink != article.preferredLink {
|
||||
var displayLink = externalLink.strippingHTTPOrHTTPSScheme
|
||||
if displayLink.count > 40 {
|
||||
displayLink = displayLink.prefix(40).appending("...")
|
||||
}
|
||||
let regarding = NSLocalizedString("Regarding", comment: "Regarding")
|
||||
let externalLinkString = "\(regarding): <a href=\"\(externalLink)\">\(displayLink)</a>"
|
||||
d["external_link"] = externalLinkString
|
||||
} else {
|
||||
d["external_link"] = ""
|
||||
}
|
||||
|
||||
d["body"] = body
|
||||
|
||||
var components = URLComponents()
|
||||
|
@ -78,6 +78,10 @@ body > .systemMessage {
|
||||
color: var(--feedlink-color);
|
||||
}
|
||||
|
||||
.externalLink {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.avatar img {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
@ -10,5 +10,6 @@
|
||||
<article>
|
||||
<div class="articleTitle"><h1>[[title]]</h1></div>
|
||||
<div class="[[dateline_style]]">[[date_medium]]</div>
|
||||
<div class="externalLink">[[external_link]]</div>
|
||||
<div class="articleBody">[[body]]</div>
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user