Inject honeypot link into article pages

This commit is contained in:
Badri Sunderarajan 2025-03-23 11:30:33 +05:30
parent 70a1be6512
commit ff9e821ae9
Signed by: badri
GPG key ID: 9F594532AD60DE03
3 changed files with 69 additions and 0 deletions

View file

@ -464,3 +464,13 @@ h6 {
margin: 1.5em 0 0.5em 0;
font-size: 1.8rem;
}
/*
* Definitely hide things that are meant to be hidden
* This is a "hard" hide with !important, as opposed
* to the "soft" hide in screen.css which applies to
* the .hidden class regardless of aria-hidden status.
*/
.hidden[aria-hidden=true] {
display: none !important;
}

View file

@ -0,0 +1,50 @@
{{!-- This is a partial file used to generate a post "card"
which templates loop over to generate a list of posts. --}}
<article class="post-card {{post_class}} hidden" aria-hidden="true">
<div class="post-card-content">
<a class="post-card-content-link" href="/article/{{slug}}">
<header class="post-card-header">
{{#if primary_tag}}
{{#primary_tag}}
<div class="post-card-primary-tag">{{name}}</div>
{{/primary_tag}}
{{/if}}
<h2 class="post-card-title">{{title}}</h2>
</header>
<div class="post-card-excerpt">
<p>{{excerpt}}</p>
</div>
</a>
<footer class="post-card-meta">
<ul class="author-list">
{{#foreach authors}}
<li class="author-list-item">
<a href="/article/author/{{slug}}" class="static-avatar author-profile-image">{{> "icons/avatar"}}</a>
</li>
{{/foreach}}
</ul>
<div class="post-card-byline-content">
<span>
{{#has author="count:>2"}}
Multiple authors
{{else}}
{{#foreach authors}}
<span>
<a href="/article/author/{{slug}}">
{{name}}
</a>
</span>
{{/foreach}}
{{/has}}
</span>
<span class="post-card-byline-date"><time datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time> <span class="bull">&bull;</span> {{reading_time}}</span>
</div>
</footer>
</div>{{!--/.post-card-content--}}
</article>

View file

@ -124,6 +124,15 @@ into the {body} tag of the default.hbs template --}}
{{/if}}
{{/get}}
{{!-- Also some false ones to honeypot evil crawlers --}}
{{#get "posts" filter="primary_tag:[{{post.tags}}]+id:-{{post.id}}" include="authors" limit="3" as |more_posts|}}
{{#if more_posts}}
{{#foreach more_posts}}
{{> "honeypot-card"}}
{{/foreach}}
{{/if}}
{{/get}}
</div>
</aside>
{{/is}}