From d6b55753a800bccd7cb6ffb44d6fe3f66cbfe4df Mon Sep 17 00:00:00 2001 From: Phil Davis <36281128+philcdavis@users.noreply.github.com> Date: Fri, 24 Jan 2020 12:02:32 -0800 Subject: [PATCH] Use item.content_markdown instead of item.content Search wasn't working, file contents weren't being indexed (content properties were empty), simple typo "item.content" needs to be "item.content_markdown". Fix gets file contents into index and I get expected search results in generated site. There may be further tweaks needed in filtering the content (for example, markdown table pipes and dashes should be filtered out), but this well enough for now. --- search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.html b/search.html index 59e55c82..c7a58f17 100644 --- a/search.html +++ b/search.html @@ -26,7 +26,7 @@

Search Results

"description": "{{item.description | xml_escape }}", "type": "{{item.type | xml_escape}}", "url": "{{ site.baseurl }}/#{{ item.id | replace: '/', '' | replace: '.', '' | xml_escape }}", - "content": {{ item.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }} + "content": {{ item.content_markdown | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }} } {% assign added = true %} {% endunless %}