So now I want to iterate through all the folders and get the page.name and page.content and page.url to implement the search functionality can you pls help me.
I tried below code and not working.
Notice I used a where_exp filter in the list of pages. Sometimes a page does not have a title in the front matter. That will remove untitled pages from the listing. If you want all of them, even without a title, then the code would look like this instead:
{% assign pages = site.pages %}
{% for page in pages %}
title: {{page.title}}
{% endfor %}
More options
I recommend you check out the list of built-in Jekyll site variables. You can learn about the different arrays you can access that Jekyll automatically collects for you. There may be other document types (like HTML docs) that you want to include as well.
Thank you it worked. I have one more issue. How can I remove the below details from page.content: by using filters in above loop
I have <img src fields in content how can I remove using filters.
I tried “content”: {{ page.content | markdownify | strip_html | markdownify | jsonify }}, but not working.
Also tried : “content”: {{ page.content | strip_html | strip_newlines | jsonify }}
tried multiple remove and replace filters but none of them working.
I have 100’s of markdown files and one of the sample markdown file is
---
permalink: "/"
---
# SEARCH :mag:
You can <b>[Search](ww.example.com)</b> with a combination of keywords. For documentation results, there is always a Markdown file listed (*.md).
# Test
Yes the this is correct. I’m implementing the search functionality in my blog by using lunr.js search functionality. For that I need to iterate all the pages in the blog using jekyll liquid tag to form as json structure. So while using the above code json structure is breaking because of some html tags. I need help on removing those html tags and make it as valid json structure.
My Markdown file code is:
# SEARCH :mag:
You can <b>[Search](https://example/search?search=1234)</b> with a combination of keywords for any of our for documentation results, there is always a Markdown file listed (*.md).
support requests to [examplesupport@example.com](mailto:example.example.com)
Below the search.html code to iterate and get it as json file
I’m implementing the search functionality in my blog by using lunr.js search functionality. For that I need to iterate all the pages in the blog using jekyll liquid tag to form as json structure. So while using the above code json structure is breaking because of some html tags. I need help on removing those html tags and make it as valid json structure.
My Markdown file code is:
# SEARCH :mag:
You can <b>[Search](https://example/search?search=1234)</b> with a combination of keywords for any of our for documentation results, there is always a Markdown file listed (*.md).
support requests to [examplesupport@example.com](mailto:example.example.com)
Below the search.html code to iterate and get it as json file