Sha256: 44bab3b6253011cadaac4b921d2e2d71f357b0ed80daeba19fc5e816ffafc9c2

Contents?: true

Size: 1.94 KB

Versions: 2

Compression:

Stored size: 1.94 KB

Contents

---
template_engine: liquid
---
[
  {%- assign looped = false %}
  {%- assign documents = site.documents %}
  {%- if site.content_engine == "resource" %}{% assign documents = site.resources %}{% endif %}
  {%- for document in documents %}
    {%- if document.title %}
      {%- unless document.exclude_from_search or document.id == "" %}
        {%- assign url = document.url %}
        {%- if site.content_engine == "resource" %}{% assign url = document.relative_url %}{% endif %}
        {%- if looped %},{% endif %}
        {
          "id": "{{ url | slugify }}",
          "title": {{ document.title | jsonify }},
          {%- if document.collection %}
          "collection": {
            "label": {{ document.collection.label | jsonify }},
            "name": {{ document.collection.name | default: "Posts" | jsonify }}
          },
          {%- endif %}
          "categories": {{ document.categories | join: ", " | jsonify }},
          "tags": {{ document.tags | join: ", " | jsonify }},
          "url": {{ url | jsonify }},
          "content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
        }
        {%- assign looped = true %}
      {%- endunless %}
    {%- endif %}
  {%- endfor %}
  {%- for document in site.pages %}
    {%- if document.name contains ".md" or document.name contains ".html" %}
      {%- if document.title %}
        {%- unless document.exclude_from_search %}
          {%- if looped %},{% endif %}
          {
            "id": "{{ document.url | slugify }}",
            "title": {{ document.title | jsonify }},
            "categories": {{ document.categories | join: ", " | jsonify }},
            "tags": {{ document.tags | join: ", " | jsonify }},
            "url": {{ document.url | jsonify }},
            "content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
          }
        {%- endunless %}
      {%- endif %}
    {%- endif %}
  {%- endfor %}
]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bridgetown-quick-search-1.1.1 content/bridgetown_quick_search/index.json
bridgetown-quick-search-1.1.0 content/bridgetown_quick_search/index.json