FHIR Chat · Jekyll help needed · IG creation

Stream: IG creation

Topic: Jekyll help needed


view this post on Zulip Jose Costa Teixeira (Feb 18 2021 at 20:52):

Is there a way to tell Dr Jekyll this?

{% assign filename =  site.data.whatever.variable.i.want  %}

{% if exists {{ filename | downcase }} %}
<p>File exists</p>
{% else %}
<p> No file here</p>
{% endif %}

view this post on Zulip Lloyd McKenzie (Feb 18 2021 at 21:03):

I think you just skip the double-braces?

view this post on Zulip Jose Costa Teixeira (Feb 18 2021 at 21:15):

if I do this

{% if exists filename %}

I get this exception
Unknown operator filename

view this post on Zulip Lloyd McKenzie (Feb 18 2021 at 21:32):

@Eric Haas

view this post on Zulip Jose Costa Teixeira (Feb 19 2021 at 20:42):

seems the issue is finding if a file exists. @Eric Haas do you know if that is possible?

view this post on Zulip Eric Haas (Feb 19 2021 at 21:51):

I could never figure how to check if file exists in Jekyll/liquid. for some files types like fixed assets you can, but never found it very useful.

view this post on Zulip Eric Haas (Feb 19 2021 at 21:52):

see https://stackoverflow.com/questions/16528783/check-for-existence-of-file-using-jekyll

view this post on Zulip Eric Haas (Feb 19 2021 at 21:55):

It would be easier to cycle through the ig resource for pages or one of the site variables or created your own list of files in the data directory.

view this post on Zulip Jose Costa Teixeira (Feb 20 2021 at 00:18):

Thanks


Last updated: Apr 12 2022 at 19:14 UTC