First steps with SB and I'd like to as for information (resources) about how to create "lua" querys.
I need a query for all notes into a folder, like a MOC (map of contents), only the main (first) level of the folder, not need to deep into all the contents.
Tried with:
${some(query[[
from p = index.subPages("01_PROYECTOS/1BAT/")
order by p.lastModified desc
limit 10 select templates.fullPageItem(p)
]]) or "Sin notas todavia!"}
and...
${some(query[[
from p = index.pages()
where p.page:startsWith("01_PROYECTOS")
order by p.pageLastModified desc
select templates.fullPageItem(p)
]]) or "Sin noticias de Gurb!"}
${query[[
from p = index.pages()
where string.startsWith(p.name, "01_PROYECTOS/") and not string.find(string.sub(p.name, #"01_PROYECTOS/" + 1), "/")
]]}
or
${query[[
from p = index.subPages("01_PROYECTOS")
where not string.find(string.sub(p.name, #"01_PROYECTOS" + 2), "/")
]]}
This filters out any subpages that have an additional / in the name (which indicates a subpage). Obviously, you could still add something like select templates.fullPageItem(p)