Jekyll serve didn’t work: It looks like you don’t have pygments or one of its dependencies installed
I had the same issue but fixed it installing pygments gem. gem install pygments.rb And adding it to my Gemfile. gem ‘pygments.rb’
I had the same issue but fixed it installing pygments gem. gem install pygments.rb And adding it to my Gemfile. gem ‘pygments.rb’
This also works at least as of 1.0.0, is built in and is simple to use. <ul> {% for post in site.posts %} <li> <a href=”https://stackoverflow.com/questions/10859175/{{ post.url }}”>{{ post.title }}</a> <p>{{ post.excerpt }}</p> </li> {% endfor %} </ul> See here.
Frontmatter This is a good workaround, add to the top of your file: — my_array: – one – two – three — then use it as: {{ page.my_array }} Analogous for site wide site.data.my_array on the _config or under _data/some_file.yml. Jekyll 3 update for layouts If the frontmatter is that of a layout, you need … Read more
There is an example in the official Jekyll documentation how to create a basic post archive page: Displaying an index of posts Bonus: For a prettier archive page (grouped by year or year/month), see this answer. You’re right, I can’t find anything in the docs where it says how the posts are ordered, but in … Read more
Don’t use posts; posts are things with dates. Sounds like you probably want to use collections instead; you get all the power of Posts; but without the pesky date / naming requirements. https://jekyllrb.com/docs/collections/ I use collections for almost everything that isn’t a post. This is how my own site is configured to use collections for … Read more
This worked like a charm for me. No plugins required. My images are in a assets/images/slider directory. {% for image in site.static_files %} {% if image.path contains ‘images/slider’ %} <img src=”https://stackoverflow.com/questions/17677094/{{ site.baseurl }}{{ image.path }}” alt=”image” /> {% endif %} {% endfor %} The image.path contains ‘images/slider’ makes sure that only images in that folder … Read more
As of version 3.7 run jekyll serve –livereload.
I think you’ll want to use the cycle tag for this. For example: {% for post in site.categories.articles %} <article class=”{% cycle ‘odd’, ‘even’ %}”></article> {% endfor %} If you want different HTML markup for each cycle: {% for item in site.posts %} {% capture thecycle %}{% cycle ‘odd’, ‘even’ %}{% endcapture %} {% if … Read more
While building my own site I came across this very same problem, and I have found an (IMHO) easy and robust solution. The Problem Given a subset of pages (not posts) on the site, list them under headings based on their categories. For example: given a set of pages which we consider resource pages (or … Read more
It can be done with much, much less Liquid code than in the existing answers: {% for post in site.posts %} {% assign currentdate = post.date | date: “%Y” %} {% if currentdate != date %} <li id=”y{{currentdate}}”>{{ currentdate }}</li> {% assign date = currentdate %} {% endif %} <li><a href=”https://stackoverflow.com/questions/19086284/{{ post.url }}”>{{ post.title }}</a></li> … Read more