home(feed): rename "View Original »" link to "Read More..."
The Latest section was showing "View Original »" for imported posts and opening every click in a new tab, even though the /api/public/posts endpoint doesn't expose an externalUrl — every link actually went to the internal /articles/<slug> page. Two changes: - Link text is now "Read More..." for every article in the feed. - target="_blank" only applies when article.externalUrl is actually populated (currently never, but keeps the door open for cross-site syndication later). Internal /articles/<slug> links now open in the same tab as the user expects. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -560,7 +560,9 @@ export default function ArticleFeed() {
|
|||||||
const articleHref = isImported && article.externalUrl
|
const articleHref = isImported && article.externalUrl
|
||||||
? article.externalUrl
|
? article.externalUrl
|
||||||
: `/articles/${article?.slug}`;
|
: `/articles/${article?.slug}`;
|
||||||
const linkProps = isImported ? { target: "_blank", rel: "noopener noreferrer" } : {};
|
const linkProps = isImported && article.externalUrl
|
||||||
|
? { target: "_blank", rel: "noopener noreferrer" }
|
||||||
|
: {};
|
||||||
|
|
||||||
// Mobile in-feed ad after every Nth article (skip if last item).
|
// Mobile in-feed ad after every Nth article (skip if last item).
|
||||||
const isAdSlot =
|
const isAdSlot =
|
||||||
@@ -621,7 +623,7 @@ export default function ArticleFeed() {
|
|||||||
{...linkProps}
|
{...linkProps}
|
||||||
className="read-more flex-shrink-0 text-[11px] focus:outline-none focus-visible:underline"
|
className="read-more flex-shrink-0 text-[11px] focus:outline-none focus-visible:underline"
|
||||||
aria-label={`Read more about ${article?.title}`}>
|
aria-label={`Read more about ${article?.title}`}>
|
||||||
{isImported ? "View Original »" : "Read More »"}
|
Read More...
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user