cobalt.rs icon indicating copy to clipboard operation
cobalt.rs copied to clipboard

How to access the collection of all pages

Open sporto opened this issue 4 years ago • 4 comments

I want to integrate lunr.js to search our site like https://booyaa.wtf/2017/adding-search-to-your-cobalt-site-part-two/. To do this I need to create a json index.

I see there is collections.posts.pages, but we don't have posts in this site. I cannot seem to find any docs about accessing all pages in the site. E.g. for page in pages or in collections.pages

Is there a way to iterate over all pages in the site? Thanks

sporto avatar Oct 14 '21 05:10 sporto

At the moment, there is not a way to access it.

In exposing it, I wonder if we should have a flag to control when to expose it so sites don't pay for it if they don't need it. That could come later as part of some of the optimization ideas I'm wanting to play with,

epage avatar Oct 14 '21 14:10 epage

Any progress on this? It'd be a great addition to the project.

jmcph4 avatar Jun 21 '22 11:06 jmcph4

Not at this time. My focus has been pulled to other projects. When I do get more attention to devote to cobalt, the highest priority is the refactoring I've started so its easier to add and maintain features like this.

epage avatar Jun 21 '22 13:06 epage

Not at this time. My focus has been pulled to other projects. When I do get more attention to devote to cobalt, the highest priority is the refactoring I've started so its easier to add and maintain features like this.

Understandable and I can empathise -- for what it's worth, this is an insanely smooth tool given what it is and I've found it incredibly useful, so thanks for all of the contributions.

jmcph4 avatar Jun 21 '22 13:06 jmcph4