Skip to content

Add a mechanism for disabling @mentions on a page #39

Open
@bkeepers

Description

@bkeepers

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-issueIssue related to a dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions