How to tell jekyll-build to skip a file that I don't want it to build?

56 Views Asked by At

As part of a process of writing papers, I usually have a markdown file in my repo - these render fine as part of the jekyll-build process, although mostly I'm just interested in rendering the HTML files I have.

Recently, I changed one of those markdown files to use a Jinja2 template to avoid some repetition. Jinja2 apaprently uses some similar syntax to Liquid. So when my template file has syntax like this:

{% macro make_binary_func(name, op) %}
// ... some stuff 
{% endmacro %}

The jekyll-build breaks, complaining about:

Liquid Exception: Liquid syntax error (line 299): Unknown tag 'macro' in 3171_boost_lambda2/boost-lambda2.tpl

Which, sure - this isn't Liquid, so it's unsurprising that it complains. Liquid seems far more limited - doesn't seem to have a function/macro construct?

Is there a way for me to get jekyll-build to either ignore this file or just treat it as raw text and something not to be rendered? All I care about is that my html file shows up on github-pages properly.

2

There are 2 best solutions below

1
Nick Christiny On

Yeah, Liquid doesn't have macros. Maybe you're looking for Raw {% raw %} {% endraw %} ?

0
mb21 On

To disable Jekyll completely on GitHub Pages:

If you publish your site from a source branch, GitHub Pages will use Jekyll to build your site by default. If you want to use a static site generator other than Jekyll, we recommend that you write a GitHub Actions to build and publish your site instead. Otherwise, disable the Jekyll build process by creating an empty file called .nojekyll in the root of your publishing source

If you want only a specific file or part of a file to not be parsed as liquid template, @Nick Christiny is right that you need to wrap it inbetween {% raw %} and {% endraw %}.