You could place the sample
folder inside the _includes
folder. Then, wrap the include tag inside <pre><code> ... </code></pre>
. So, it'd look like the following:
# inside _includes/samples/trafikito.html
<div>
<h1>Test Code<h1>
<p>Test Code</p>
</div>
================
# inside the file where you want to include the sample
...
<pre>
<code>
{% include samples/trafikito.html %}
</code>
</pre>
...
This works for any source code file type (.html
, .json
, etc.) since Jekyll just inserts the full file contents into the destination file. The inserted code is surrounded by tags that tell the browser to render the contents as textual code not as actual code