Is there a way to use HTML and JS in a .yml?

Looking to create some logic (js) in one of my .yml files. Along with a <a href = "mailto: attribute. Is this possible in the file?

you can. . . sort of.

it’s more likely that you’d have something like this in your yaml:

   some_logic_switch: True

And then in your page templates:

<a href="mailto:{{$.Param "mail_to"}}">contact us</a>

{{ if $.Param "some_logic_switch" }}
    <p>you'll see me if switch is true</p>
{{ end }}

If you mean that you want to inject your mailto address into a javascript file, use .ExecuteAsTemplate:

The example given is for css, but you just use .js instead.

Yes so that’s currently what I’m doing with the mailto element. at the moment, what about custom JS in the .yml? I need to add a formula to one of my items, is this possible?

I’m not sure exactly what you mean? If you mean you want to have your config .yaml contain a string that happens to be javascript that you can inject into your .js file, follow the link above for creating a resource from template, and in your config have:

  some_js: console.log("hello 2")

and then in your .js template:

// assets/js/myfile.js
console.log("hello 1");
{{ .Param "some_js" }};

You can do the same thing via string if you don’t have/want a javascript file - see here for a full example: