How to create a widget to show N recent pages at the bottom of every page?

I’m trying to make a query to display the N (N=10) most recently created/updated pages, not including this one, as a clickable link followed by the page’s text (the whole thing, ideally). Trying to replicate logseq’s scrollable journal, basically.
I have this template which doesn’t work:

---
tags: template
description: A page reference link as a list item, with snippet preview
---
_____
**Page [[{{name}}]]**:
{{[[{{name}}]]}}

The link works, but not the fancy nested syntax ({{[[{{name}}]]}}) to get the page’s content.

Can you use something like this instead? {{readPage(name)}}

I have an example of a template similar to what you’re trying to do:

```template
{{#each {page where name =~ /^Journal/ order by modified, created limit 5}}}
# [[{{name}}]]
{{readPage(name)}}
{{/each}}
```
1 Like

This is very useful to me, thanks