adding root level pages to the searchindex #716
Replies: 8 comments 1 reply
-
You can get all generated pages in an event listener and do whatever you want with them (e.g. generate a sitemap): Is this what you're after? |
Beta Was this translation helpful? Give feedback.
-
no, i want to add a number of pages to the searchIndex. so i would like to add index.blade.php, gardening.blade.php and itsupport.blade.php to the searchIndex.json that is created at the end of the build process but these are the pages in the root of the source directory, so i want to make an array/collection of them and hard code the filenames to add to the searchIndex. Alternatively, i could create them in a sub directory and use a 301 html redirect to forward the old page. |
Beta Was this translation helpful? Give feedback.
-
How are you generating the Are you by any chance using one of the starter templates? |
Beta Was this translation helpful? Give feedback.
-
yes i am using the blog template with the fuse search. you can see it in action here, https://allotmentandy.github.io/ thanks for your help with this issue |
Beta Was this translation helpful? Give feedback.
-
The blog starter template generates the JSON file in an event listener. You can modify the |
Beta Was this translation helpful? Give feedback.
-
i tried that, but there is no collection for pages, so i wonder what i would do to create an additional collection one in the config.php and then add them in that GenerateIndex.php file. would it just be an array/collection of filenames? |
Beta Was this translation helpful? Give feedback.
-
Check the helper methods in the docs. You can use |
Beta Was this translation helpful? Give feedback.
-
i meant the root pages, i would like to add the contact, about and index pages as part of the search, as users expect that. can anyone point me into how to so this? i have added the 'front matter yaml' to each page to provide the details for each. |
Beta Was this translation helpful? Give feedback.
-
hi, i am looking to add a number of pages at the root level of a jigsaw site to the searchIndex
there isnt a collection called pages (as there is for posts)
is there an easy way to do this? i would prefer to have a collection in the config.php file which states which php and md pages to add to the searchIndex if possible.
hope you can help and point me in the right direction.
thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions