Appending Multiple Fields In Twig I'm attempting to append two fields with some text in the middle. Using the changed date and a plain, core, text field, I can do something like this, and it works:

{{ node.changed.value|date('m.d.y') ~ ' | By, '}}{{ content.field_author_name.0 }}


However, if I attempt to do that in a single tag, the changed date, and the 'By' text is output, but I don't get the author name field.

{{ node.changed.value|date('m.d.y') ~ ' | By, ' ~ content.field_author_name.0 }}


Is that not valid twig syntax, or is there something else needed to get that to work in a single statement?
When using {{ content.field_author_name.0 }} it works because field is rendered with the twig.
The ~ operator converts all operands into strings and concatenates them. Given that content.field_author_name.0 is a render array you need point to the string value of this field. To do this you can inspect it with the devel or twig_vardumper module using dump(content.field_author_name.0). More about debugging twig templates: https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates#s-viewing-variables

Assuming that field_author_name is simple text field with the Plain text formatter, this should work:

{{ node.changed.value|date('m.d.y') ~ ' | By, ' ~ content.field_author_name.0['#context'].value }}


To display node creator name you can use this:

{{ node.changed.value|date('m.d.y') ~ ' | By, ' ~ node.uid.entity.name.value }}