YAML exception (<unknown>)

I have the following in a template that I want to use for replying to tweets, Indieweb style. Using the HTML entity for “@” before each username produces the error shown in the subject above.

As the only YAML involved is declaring the layout, is this really a Liquid error?

<article class="h-entry">
<h1 class="p-name"><a class="u-url" href="{{ page.url }}">{{ page.title }}</a></h1>
<div class="meta"><time datetime="{{ page.date | date: "%Y-%m-%d" }}" class="dt-published">{{ page.date | date: '%B %-d, %Y' }}</time></div>
<div><a class="u-in-reply-to" href="{{ tweet-url }}"></a></div>
<div class="e-content">&#65312;{{ twitter-user }}&nbsp;{{ content }}
<a href="https://brid.gy/publish/twitter?bridgy_omit_link=true"></a>

Does the error give a file or line number? Could the problem be in the site’s _config.yml?

Note that the @ sign is a special character in YAML, so the following is an error:

twitter_username: @jekyllrb

To use the @ sign the string must be quoted:

twitter_username: "@jekyllrb"
1 Like


I originally tried escaping the @, but that didn’t work.

If I quote the username in a note’s frontmatter, and access it in the layout with @{{ page.twitter-user }}, this looks like it will do what I was looking for.

If Aaron Gustafson’s Jekyll Webmention plugin ever lands its PR for syndication, this will get much easier. Until then, we’re kind of stuck with weird workarounds.