Except for permalink template syntax in data is not processed. This affects things like the default description in posts.json and pages.json. I couldn't get eleventyComputed to work (there may be a 11ty/njk bug) but I achieved a similar effect by modifying the head.njk partial. See below. I thought you might find this useful.
{%- set pageDescription -%}
{%- if tag -%}
{{ phrases.view_all_articles_tagged_as }} {{ tag.title|capitalizeAllWords }}
{%- elif description -%}
{{ description | truncate(140) }}
{%- elif (tags or []).indexOf('post') > -1 -%}
{{- page.excerpt -}}
{%- elif (tags or []).indexOf('page') > -1 -%}
{{- title -}}
{%- else -%}
{{ siteConfig.site.description }}
{%- endif -%}
{%- endset -%}
Thank you for this excellent 11ty template.
Except for permalink template syntax in data is not processed. This affects things like the default description in posts.json and pages.json. I couldn't get eleventyComputed to work (there may be a 11ty/njk bug) but I achieved a similar effect by modifying the head.njk partial. See below. I thought you might find this useful.
{%- set pageDescription -%} {%- if tag -%} {{ phrases.view_all_articles_tagged_as }} {{ tag.title|capitalizeAllWords }} {%- elif description -%} {{ description | truncate(140) }} {%- elif (tags or []).indexOf('post') > -1 -%} {{- page.excerpt -}} {%- elif (tags or []).indexOf('page') > -1 -%} {{- title -}} {%- else -%} {{ siteConfig.site.description }} {%- endif -%} {%- endset -%}