Add /data/search-index.json

This commit is contained in:
Rico Sta. Cruz 2017-10-23 12:43:22 +08:00
parent 9da29c6a65
commit 26071b3a7d
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 22 additions and 0 deletions

21
data/search-index.json Normal file
View File

@ -0,0 +1,21 @@
---
layout: blank
type: other
---
{% assign pages = site.pages
| where_exp: "page", 'page.type == "article"'
%}[
{% for page in pages
%}{% if forloop.index0 != 0 %},{% endif %}{
"id": {{ page.url | replace: ".html", "" | slice: 1, 9999 | jsonify }},
"title": {{ page.title | jsonify }},
"url": {{ page.url | replace: ".html", "" | jsonify }},
"category": {{ page.category | jsonify }},
"keywords": {{ page.keywords | jsonify }},
"content_html": {{ page.content | markdownify | strip | jsonify }},
"intro_html": {{ page.intro | markdownify | strip | jsonify }},
"description_html": {{ page.description | markdownify | strip | jsonify }},
"tags": {{ page.tags | jsonify }},
"updated": {{ page.updated | jsonify }}
}{% endfor %}
]

View File

@ -1,5 +1,6 @@
---
layout: blank
type: other
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">