Open wongyah opened 3 years ago
@wongyah what jekyll version?
@msangel jekyll 4.2.0 on Win10
Following this cause same issue
Same here. The filters do nothing at all.
⚠️ {% toc %} Tag Limitation
{% toc %}
works only for Jekyll Posts and Jekyll Collections. If you'd like to use{% toc %}
exceptposts
orcollections
, please use toc_only filter as described below.
_posts/*.md
或者_**/*.md
(合集),比如about.md
;只能使用{{ content | toc_only }}
_posts/*.md
or_**/*.md
(collection), such as about.md
; you must only use {{ content | toc_only }}
{% toc %}
{{ content | toc_only }}
What I did
1. Add
gem 'jekyll-toc'
to my gemfile.My gemfile is very simple, looks like this:
2. Run
bundle install
in the command line.I received the message below:
Bundle complete! 3 Gemfile dependencies, 32 gems now installed.
3. Add Jekyll-toc to _config.yml.
My _config.yml file looks similar to what is shown on the Jekyll Docs:
4. Add
toc: true
to my layout of a collection, and replace the{{ content }}
with {{ content | toc }}, to see if the plugin work or not.5. Run
bundle exec jekyll serve
again to rebuild the site locally.The pages in the collection folder are completely same to previous, no table of content is added.
What is wrong?
I have read all the instructions and explanations I could find on web, including the jekyll docs and jekyll-toc readme, but it just doesn't work.
Did I do something wrong with it? Or something I missed?
Thanks!