Closed xplosionmind closed 2 years ago
Are you passing a base
argument to the htmlToAbsoluteUrls
filter?
For example {{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}
This worked for me: https://github.com/pdehaan/11ty-rss-31
---
# src/index.njk
title: HOMEPAGE
---
<p>{{ site.baseUrl }}</p>
{% for post in collections.pages %}
{% set absolutePostUrl %}{{ post.url | url | absoluteUrl(site.baseUrl) }}{% endset %}
<article>
{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) | safe }}
</article>
{% endfor %}
Where my src/_data/site.js file looks like this:
// src/_data/site.js
module.exports = {
baseUrl: "https://pdehaan.dev/"
};
yep, I omitted {% set absolutePostUrl %}{{ post.url | url | absoluteUrl(site.baseUrl) }}{% endset %}
. Thanks a lot!
While building, I get this error and I cannot understand how to fix it.