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

absolute_url fails silently when permalink is defined #7

Open
S0AndS0 opened this issue Jan 2, 2021 · 0 comments
Open

absolute_url fails silently when permalink is defined #7

S0AndS0 opened this issue Jan 2, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@S0AndS0
Copy link
Member

S0AndS0 commented Jan 2, 2021

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

@S0AndS0 S0AndS0 added the bug Something isn't working label Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant