Skip to content

Instantly share code, notes, and snippets.

@iglunchadze
Created November 27, 2023 10:19
Show Gist options
  • Save iglunchadze/c2e888d53cb55af335b1af494620416e to your computer and use it in GitHub Desktop.
Save iglunchadze/c2e888d53cb55af335b1af494620416e to your computer and use it in GitHub Desktop.
Diplodoc: warning about variable in conditionally hidden code block

Index

{% if product == "a" %}

{{ prop }} {{ props.0 }} {{ props.1 }}

{% else %}

{{ props.0 }}

{% endif %}

Build command and logs

Command:

yfm -i diplodoc-test/ -o diplodoc-test-gen/ --varsPreset product-b

Actual output:

...
WARN Variable props.1 not found in /index.md
WARN Variable prop not found in /index.md

Expected output:

(no warnings)
default: {}
product-a:
product: a
prop: prop-a
props:
- props-a1
- props-a2
product-b:
product: b
props:
- props-b1
title: Test document
items:
- name: Index
href: index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment