Query results in table with links

I have this query to quickly see notes I have recently modified.

${query[[from index.tag "page" order by lastModified desc limit 100]]}

  • Is it possible to display results as links for quick navigation to the pages?
  • There are many pages starting with Library/. I guess these are system pages. Is it possible to filter these out from the query?

You can use a where clause, for example:
where not string.match(name, "Library/")

To display links, you can use one of the default query templates called pageItem and wrap your query:

${template.each(query[[ from index.tag "page" order by lastModified desc limit 10 select {name=name} ]], templates.pageItem)}

I use following query in combination with a space-lua for customising the date :

# 📔 Recent Notes 
${query[[ 
from index.tag "page" 
where not table.includes(tags,"meta") and not name:startsWith("Library/Std")
order by lastModified desc
select {
  Page = "[[" .. name .. "]]",
  Modified = os.date("%Y-%m-%d %H:%M:%S", parse_iso_datetime(_.lastModified)),
  Tags = tags and #tags > 0 and "#" .. table.concat(tags, " #") or ""
  }
limit 20
]]}

here is the space-lua function to format the date:

function parse_iso_datetime(str)
  local year, month, day, hour, min, sec = str:match("(%d+)%-(%d+)%-(%d+)T(%d+):(%d+):(%d+)")
  return os.time({
    year = year,
    month = month,
    day = day,
    hour = hour,
    min = min,
    sec = sec,
  })
end

this will create following table with the clickable name which will jump directly to that page:

I’m pretty sure there is an easier way to do this, but this works for me. and what’s not broken, I don’t try to fix it :stuck_out_tongue:

Thanks! That is very interesting. Both solutions worked well.