Giter VIP home page Giter VIP logo

Comments (6)

piny940 avatar piny940 commented on June 25, 2024 1

I checked the version of yadm and I found it was old.

$ yadm version
yadm 3.1.1

When I upgrade yadm to the latest version, everything worked fine. Thank you for your support.

from yadm.

rasa avatar rasa commented on June 25, 2024

In https://yadm.io/docs/templates it says

If multiple classes are defined, yadm.class=="someclass" will be true if any of the defined classes are “someclass”.

Please try that, and let us know your results.

from yadm.

piny940 avatar piny940 commented on June 25, 2024

The classes are mango and peach:

$ yadm config --get-all local.class
mango
peach

In the test##template, I've written:

{% if yadm.class=="mango" %}
mango
{% endif %}
{% if yadm.class=="peach" %}
peach
{% endif %}

However, the content of 'test' only became:

peach

It appears it only checks the result of yadm config local.class.

from yadm.

rasa avatar rasa commented on June 25, 2024

@piny940 Can you try

{% if yadm.classes=="mango" %}
mango
{% endif %}
{% if yadm.classes=="peach" %}
peach
{% endif %}

Perhaps the doc is wrong on the syntax.

from yadm.

piny940 avatar piny940 commented on June 25, 2024

Unfortunatlly, it didn't work. The content of test became empty.

from yadm.

piny940 avatar piny940 commented on June 25, 2024

I've written test##template as follows:

{% if yadm.classes=="mango" %}
mango
{% endif %}
{% if yadm.classes=="peach" %}
peach
{% endif %}

Variables:
{{ yadm.class }}
{{ yadm.classes }}

Then the content of test became:


Variables:
peach
{{ yadm.classes }}

It appears yadm.classes does not work in template file.

from yadm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.