Describe the bug
When post.id is undefined, the post.url filtered through absolute_url should be used. Branching via if/else functions as intended, however, for unknown reasons the absolute_url Jekyll filter is failing to produce a full URL. Instead only the collection name and post slug survives.
This seems to be some kind of bug that is triggered when permalink is defined/configured.
Example Setup
_config.yml (snip)
url: 'https://liquid-utilities.github.io'
collections_dir: documentation
collections:
example-collection:
output: true
permalink: /:collection/:name/
_layout/test-absolute-url.html
{% assign collection__data = collection[page.collection_name] %}
{% for post in collection__data %}
URL: {{ post.url | absolute_url }}
{% endfor %}
documentation/_exapmple-collection/test-absolute-url.md
---
layout: post
title: Tests Absolute URL Filter
description: Example post that collection layout will fail to parse URL for
---
example-collection.html
---
layout: test-absolute-url
collection_name: example-collection
---
Example Results
Build then navigate to example-collection URL similar to; https://<acount>.github.io/<project>/example-collection.html
Output will likely be presented similar to...
URL: /example-collection/test-absolute-url
Expected Behavior
Output should be presented similar to...
URL: https://<acount>.github.io/<project>/example-collection/test-absolute-url
... this is what feed-atom and feed-rss2 layouts from liquid-utilities achieve, and there doesn't appear to be any major differences in how post.url is filtered by absolute_url
Describe the bug
When
post.idis undefined, thepost.urlfiltered throughabsolute_urlshould be used. Branching viaif/elsefunctions as intended, however, for unknown reasons theabsolute_urlJekyll filter is failing to produce a full URL. Instead only the collection name and post slug survives.This seems to be some kind of bug that is triggered when
permalinkis defined/configured.Example Setup
_config.yml(snip)_layout/test-absolute-url.html{% assign collection__data = collection[page.collection_name] %} {% for post in collection__data %} URL: {{ post.url | absolute_url }} {% endfor %}documentation/_exapmple-collection/test-absolute-url.mdexample-collection.htmlExample Results
Build then navigate to example-collection URL similar to;
https://<acount>.github.io/<project>/example-collection.htmlOutput will likely be presented similar to...
Expected Behavior
Output should be presented similar to...
... this is what
feed-atomandfeed-rss2layouts fromliquid-utilitiesachieve, and there doesn't appear to be any major differences in howpost.urlis filtered byabsolute_url