Open
Description
I'm following the Jekyll search using lunr.js guide, and one step involves outputting JSON on the page:
…
<script>
window.store = {
{% for post in site.posts %}
"{{ post.url | slugify }}": {
"title": "{{ post.title | xml_escape }}",
"author": "{{ post.author | xml_escape }}",
"category": "{{ post.category | xml_escape }}",
"content": {{ post.content | strip_html | strip_newlines | jsonify }},
"url": "{{ post.url | xml_escape }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
};
</script>
…
This works fine, except that the jekyll-mentions plugin still finds @mentions in content
and autolinks them, which then breaks the json.
For this specific use case, one solution is to move just the json to a separate file called content.json
, since jekyll-mentions only operates on html pages.
Are there other uses cases though where it might make sense to allow disabling @mentions per-page?