Skip to content

Commit c9b2fdb

Browse files
committed
Make news item titles clickable
1 parent 2c23692 commit c9b2fdb

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

source/exts/nxt.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,20 +440,20 @@ def depart_nxt_tabs(self, node: Element) -> None:
440440

441441
def __write_news_entry(self, e: List[dict], prefix: str = "") -> None:
442442
date = datetime.fromisoformat(e["date"]).strftime("%B %-d, %Y")
443-
self.body.append(
444-
f"""
445-
<div class=nxt_news_item>
446-
<h2>
447-
{e['title']}
448-
<a class=headerlink href={prefix + e['anchor']}
449-
title="Permalink to this headline">§</a>
450-
</h2>
451-
<p class=nxt_news_authordate>
452-
{e['author']}&nbsp;on&nbsp;{date}
453-
</p>
454-
<p>{e['description']}</p>"""
455-
)
456443
if "relurl" in e:
444+
self.body.append(
445+
f"""
446+
<div class=nxt_news_item>
447+
<h2>
448+
<a href={e["relurl"]}>{e['title']}</a>
449+
<a class=headerlink href={prefix + e['anchor']}
450+
title="Permalink to this headline">§</a>
451+
</h2>
452+
<p class=nxt_news_authordate>
453+
{e['author']}&nbsp;on&nbsp;{date}
454+
</p>
455+
<p>{e['description']}</p>"""
456+
)
457457
domain = urlparse(e["relurl"]).netloc
458458
if domain.startswith("www."):
459459
domain = domain[4:]

source/theme/static/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ iframe {
180180
#content h3 .headerlink {
181181
color: #00974d;
182182
}
183+
#content h2 a {
184+
color: #00974d;
185+
}
183186
#content .headerlink {
184187
visibility: hidden;
185188
display: inline-block;

0 commit comments

Comments
 (0)