remove anchors from teasers, they have a stretched-link on top

This commit is contained in:
Barış Soner Uşaklı 2024-02-05 10:55:24 -05:00
parent e38ea9dcca
commit 72f7a42258
4 changed files with 10 additions and 7 deletions

View file

@ -186,3 +186,8 @@ library.filterMiddlewareRenderHeader = async function (hookData) {
return hookData;
};

library.filterTeasersConfigureStripTags = function (hookData) {
// teasers have a stretched-link to go to last post, the anchors in them are not clickable
hookData.tags.push('a');
return hookData;
};

View file

@ -8,7 +8,8 @@
{ "hook": "filter:settings.get", "method": "getAdminSettings"},
{ "hook": "filter:user.saveSettings", "method": "saveUserSettings" },
{ "hook": "filter:user.profileMenu", "method": "addProfileItem" },
{ "hook": "filter:middleware.renderHeader", "method": "filterMiddlewareRenderHeader" }
{ "hook": "filter:middleware.renderHeader", "method": "filterMiddlewareRenderHeader" },
{ "hook": "filter:teasers.configureStripTags", "method": "filterTeasersConfigureStripTags"}
],
"scripts": [
"public/harmony.js"

View file

@ -4,9 +4,7 @@
<div component="category/posts" class="ps-2 text-xs d-flex flex-column h-100 gap-1">
<div class="text-nowrap text-truncate">
<a class="text-decoration-none" href="{config.relative_path}/user/{./user.userslug}">{buildAvatar(posts.user, "18px", true, "avatar-tooltip")}</a>
<a class="permalink text-muted" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}">
<span class="timeago text-xs" title="{../timestampISO}"></span>
</a>
<a class="permalink text-muted timeago text-xs" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}" title="{./timestampISO}" aria-label="[[global:lastpost]]"></a>
</div>
<div class="post-content text-xs text-break line-clamp-sm-2 lh-sm position-relative flex-fill">
<a class="stretched-link" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}" aria-label="[[global:lastpost]]"></a>

View file

@ -111,11 +111,10 @@
{{{ if ./teaser.pid }}}
<div class="ps-2">
<a href="{config.relative_path}/user/{./teaser.user.userslug}" class="text-decoration-none">{buildAvatar(./teaser.user, "18px", true, "avatar-tooltip not-responsive")}</a>
<a class="permalink text-muted timeago text-xs" href="{config.relative_path}/topic/{./slug}/{./teaser.index}" title="{./teaser.timestampISO}">
</a>
<a class="permalink text-muted timeago text-xs" href="{config.relative_path}/topic/{./slug}/{./teaser.index}" title="{./teaser.timestampISO}" aria-label="[[global:lastpost]]"></a>
</div>
<div class="post-content text-xs ps-2 line-clamp-sm-2 lh-sm text-break position-relative flex-fill">
<a class="stretched-link" href="{config.relative_path}/topic/{./slug}/{./teaser.index}"></a>
<a class="stretched-link" href="{config.relative_path}/topic/{./slug}/{./teaser.index}" aria-label="[[global:lastpost]]"></a>
{./teaser.content}
</div>
{{{ end }}}