Skip to content

Inconsistent use of absolute_url vs. relative_url filter #1408

@vorth

Description

@vorth

I'm using a Docker container to test my site, either locally or with a GitHub Codespace. It works marvelously, for everything except one detail: many of the links are absolute URLs saying "http://0.0.0.0:4000/...". These are constructed as href attributes something like this:

href="{{ post.url | absolute_url }}"

These will never work in a container environment, since the container and server cannot possibly know how traffic is being directed to them, often through some generated domain name.

The relative_url filter seems to be the appropriate one in all cases, as far as I can tell. Your theme has about an even mix of both absolute_url and relative_url. Is there a reason they are not all relative_url?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions