Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template syntax not recognised in data cascade #120

Open
cioportfolio opened this issue Apr 29, 2024 · 1 comment
Open

Template syntax not recognised in data cascade #120

cioportfolio opened this issue Apr 29, 2024 · 1 comment

Comments

@cioportfolio
Copy link

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 -%}

@lwojcik
Copy link
Owner

lwojcik commented Apr 29, 2024

Hi @cioportfolio,

Thanks for letting me know! I'll have a look at this soon-ish.

May is coming and I'm having some days off, so it might have to wait a little longer, but I'll get back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants