Need help with YAML in Obsidian Web Clipper

What I’m trying to do

I’m trying to standardize my note structures from my 2 main sources, Readwise reader and the Obsidian Web clipper
First task is getting the actual note titles to match my preferred format
<authorlastname>-<authorfirstname>_<title_with_no_spaces>-<optionalsource>
I’ve got the Readwise one working using this as the file name
{% set name = author|trim %}{{name.split(" ")|last}}_{%set name = author|trim %}{{name.split(" ")|first}}-{{title|replace(' ', '_')}}-{{source}}
but I can’t seem to code the same thing in Obsidian’s clipper and get it to work. I was trying to leave off the source and use this string instead
{% set name = author|trim %}{{name.split(" ")|last}}-{%set name = author|trim %}{{name.split(" ")|first}}_{{title|replace(' ', '_')}}
I suspect it’s a missing or extra { or } but I’m not seeing it.
The final format I want from Obsidian Clipper is
<authorlastname>-<authorfirstname>_<date>_<title_with_no_spaces>

Things I have tried

I’ve read the entire section in the help docs about the web clipper about the templates, variables and filters and I believe what I want to do can be done but I just don’t know enough to see the problem.