Skip to content

Instantly share code, notes, and snippets.

@arielsalminen
Created April 26, 2021 11:25
Show Gist options
  • Save arielsalminen/25a569b70222a65e2fd98bfaff2f1604 to your computer and use it in GitHub Desktop.
Save arielsalminen/25a569b70222a65e2fd98bfaff2f1604 to your computer and use it in GitHub Desktop.
---
permalink: search.json
eleventyExcludeFromCollections: true
---
{"search" : [
{%- for page in collections.all %}
{
"url" : "{{ page.url }}",
"title" : "{% if page.data.title %}{{ page.data.title }}{% else %}Nord Design System{%- endif -%}",
"text" : "{% if page.data.intro %}{{ page.data.intro | squash }}{%- endif -%} {% if page.data.description %}{{ page.data.description | squash }}{%- endif -%} {{ page.templateContent | squash }}",
"readabletitle" : "{{ page.data.title | indexer }}",
"keywords" : "{{ (page.data.title + " " + page.templateContent) | indexer }}{% if page.data.intro %}{{ page.data.intro | indexer }}{%- endif -%} {% if page.data.description %}{{ page.data.description | indexer }}{%- endif -%}"
}{% if not loop.last %},{% else %}{%- endif -%}
{%- endfor %}
]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment