1

I need to include raw text from a bunch of files inside a Jekyll collection. I don't want to process them in any way, I just need to dump the raw text using a collection. It feels like the following should work:

---
layout: default
---

{% for item in site.fragments %}
  {{ item.content }}
{% endfor %}

I have declared the collection in the _config.yml file, like so:

collections:
  - fragments

Surprisingly, the output of item.content is not the raw text inside the file, but rather the processed HTML that results from running Jekyll on top of the file.

Clearly I must be misunderstanding something fundamental, since stitching together text files should be trivial for a text processor like Jekyll.

glopes
  • 4,038
  • 3
  • 26
  • 29
  • And what is your problem ? – David Jacquel May 22 '18 at 16:48
  • @DavidJacquel the problem is that the above does not work. The file contents do not contain the raw text but rather processed HTML. I will add this explicitly to the question though, as it was indeed a bit lacking – glopes May 22 '18 at 21:58
  • Does this answer your question? [Include Jekyll/Liquid code without rendering it](https://stackoverflow.com/questions/37688226/include-jekyll-liquid-code-without-rendering-it) – mhansen Sep 08 '20 at 10:42

0 Answers0