---
type: Article
title: Filtered Topic Supplementary Posts
description: In a bout of inspiration this week I changed some of the framework on this site with unexpected results.
resource: https://www.simoncox.com/short-articles/2026-07-26-filtered-topic-supplementary-posts/
tags: [Shorticles, Web, Eleventy]
timestamp: 2026-07-26
---

In a bout of inspiration this week I changed some of the framework on this site. It started by realising that the additional content below an article was wrapped up in the article tag. I found this when I tested SEOTesting’s new Content Evaluator tool and it suggested that there were parts of the page that were nothing to do with the main content. And it was correct - the Secondary links to other content, Articles and Notes were inside the article tag which gives the wrong indications to anything crawling the site.

## Content structure

I moved those elements after the actual article into their own Aside tag.
```
<main>
	<article>
		The article
	</article>	
	<aside>
		Links to other articles
	</aside>
</main>		
```

### The Print CSS
While I was making these changes someone mentioned on Mastodon that they were checking their print css. I had a look at my pages and realised the Aside and Footer were not really needed if anyone ever wanted to print out a page so they are now hidden with a simple css statement:
```
@media print {
  aside,
  footer {
    display: none;
  }
}
```
Have a look - try printing out this page!


## Filtering the secondary content by topic
The Secondary content has always been Featured content, the Latest Articles and the Latest Notes (used to be called shorts and shorticles - but that change is for another story). 

That then made me think instead of the latest posts why not have the latest posts in the same topic – people are much more likely to read other things if they are related. The content oin this site sis somewhat eclectic, like me, and probably like most people – it’s not a one topic site.


### 11ty filter for the topics
To do this I needed to create a filter in 11ty 

```
module.exports = function(eleventyConfig) {
    eleventyConfig.addFilter("byTopic", (posts, topic) => {
        return posts.filter(post => post.data.topic === topic);
    });
};
```
I then call this in the page layout:

{% raw %}
```
<h2>Other {{ topic }} Main Articles</h2>
<ul class="cluster">
	{%- set related_posts = collections.Post | reverse | byTopic(topic) -%}
	{%- for post in related_posts %}
	{%- if post.url != page.url and loop.index <= 3 %}
	<li class="articlecards {% if post.data.tags %} {{ post.data.tags | join(' ') }}{% endif %}">
		{% if post.data.image %}<img src="{{ post.data.image }}" alt="{{ post.data.imageAlt }}">{% endif %}
		<h3><a href="{{ post.url}}">{{ post.data.title }}</a></h3>
	</li>    
	{%- endif %}
	{%- endfor %}
</ul>
<p><a href="/post/">Or all the Main Articles</a></p>
```
{% endraw %}

That one is for the Articles and I have a similar partial for the Notes.






## The result of filtering topics 
Having topic related secondary content links should increase the likelihood of a visitor visiting other pages. Below is a snapshot of traffic to his site showing in the darker coloured area as the number of visors and the lighter coloured area showing the number of pages visited. This is generally close as people tend to view one perhaps two pages per visit. 

Since implementing this change there is a dramatic rise in the number of pages visited as there is potentially more appropriate content to hand. 

![Graph showing a months worth of visits and pages with arrow showing the point of the changes and anther arrow showing the large peak in pages a couple of days afterwards](/assets/img/content/2026-07-26-filtered-topic-supplementary-posts.png)

## Afterthought on the secondary content
Going back to the start I am now wondering if tucking the topics filtered secondary content links back into the article tag might benefit the article itself. I will leave that for another time. 

[Read full article](https://www.simoncox.com/short-articles/2026-07-26-filtered-topic-supplementary-posts/)
