v2.5.0
A page whose body was built from template tags described itself with their
source. # {{ site.title }} over {{ site.description }} shipped an
og:description reading "site.description" and an anchor at #site-title,
while the page itself rendered the real title and the real description right
underneath. The build stayed green through both, and the only symptom was a link
preview nobody looks at until someone shares the page.
Added
- A
descriptionfilter emits<meta name="description">, escaped.
{{ page | description(site) }}(Liquid:{{ page | description: site }})
reads the same chainogandjsonlddo — front matterdescription, then
the page's auto-excerpt, thensite.description— so the three cannot
disagree, and emits nothing when none of them is set. Poops renders with
autoescape off, so a layout writing that tag by hand ships the front matter
verbatim: one"in a sentence closes the attribute and truncates the
description to the words before it, silently, on a green build. Poops' own
v2.4.0 post described itself asAfor exactly that reason. Escaping now
happens in one named place rather than in every layout that remembers.
Fixed
-
page.excerptis taken after the template engine has run. A first
paragraph written as{{ site.description }}, or supplied by an
{% include %}ahead of the prose, is resolved before the text is taken, so
the description is the one a reader gets. The excerpt now reads the rendered
body's first<p>rather than guessing at the markdown source — headings,
comments, code fences and tables are skipped because they are not paragraphs,
and link text comes through without its URL. When nothing usable resolves the
excerpt is empty andog/jsonld/<meta name="description">fall through to
site.description— the old behaviour was to strip the braces and ship
site.descriptionas a literal string, which then beat the very value it was
standing in front of. Only pages whose first paragraph is a tag pay for the
extra render.A collection item is read without a page context, so its
excerptis empty in
that case rather than resolved; listings and feeds fall back to the item's
description. The item's own page still resolves it. -
Heading
ids are slugged from the rendered heading.# {{ site.title }},
# {{ page.title }}and# My Sitenow all anchor at#my-site, so swapping
which variable feeds a heading no longer remints every bookmarked URL. The
tocfilter slugs from the same text, so its links still land.
Full Changelog: v2.4.0...v2.5.0