Open bkeepers opened 8 years ago
This works fine, except that the jekyll-mentions plugin still finds @mentions in content and autolinks them, which then breaks the json.
Is it linking the mention once it's been jsonified, or the content when it renders the underlying post?
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.
Exactly what I was going to suggest.
Are there other uses cases though where it might make sense to allow disabling @mentions per-page?
Yes and no. The case is if you include CSS in a page and it has an @media
attribute. However, disabling in this case absolutely makes sense.
I'd prefer a way to prevent single @…
statements from being linked, e.g. by escaping the @
like in \@something
. This is how it works for other markdown, too.
See also: jch/html-pipeline#232 and jch/html-pipeline#250
I'm wholly 👍 to the idea of a front-matter option like jekyll-mentions: disable
or jekyll-mentions: false
or disable_plugins: [jekyll-mentions]
on a per-page/per-document basis.
Also, would be super nice if you could override the base_url
for a single file, such as
jekyll-mentions: https://twitter.com
in your _config.yml
, but
jekyll-mentions: https://github.com
for a different file to use that base_url.
I made a fork of this gem, and made both of the changes discussed here: https://github.com/emma-sax4/jekyll-mentions.
So, we can override the base_url
in each specific page/post frontmatter. Or, we can disable mentioning on a specific page/post by specifying false
:
jekyll-mentions: false
It can be included by specifying this in the Gemfile:
gem 'jekyll-mentions', :git => 'https://github.com/emma-sax4/jekyll-mentions.git'
@bkeepers I would like to inform you that this feature has landed on the master
!! :tada: :sparkles:
If you're still using this plugin, do let us know if it works for your use-case. Thanks.
I'm following the Jekyll search using lunr.js guide, and one step involves outputting JSON on the page:
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?