Inject honeypot link into article pages
This commit is contained in:
parent
70a1be6512
commit
ff9e821ae9
3 changed files with 69 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
50
partials/honeypot-card.hbs
Normal file
50
partials/honeypot-card.hbs
Normal 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">•</span> {{reading_time}}</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>{{!--/.post-card-content--}}
|
||||
|
||||
</article>
|
9
post.hbs
9
post.hbs
|
@ -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}}
|
Loading…
Reference in a new issue