Skip to content

get_url: always add trailing slash unless path has extension? #2026

@dannyvankooten

Description

@dannyvankooten

I just migrated my blog from Jekyll to Zola and after it's been great once I got the hang of it! Thank you for your great work on it.

One thing I ran into and that the docs were a tiny bit ambiguous about was the proper way to generate permalinks using the get_url Tera function.

The documentation for get_url states:

By default, assets will not have a trailing slash.

This + #85 gave me the impression that get_url('/about/) would return https://mysite.com/about/ but it was stripping the trailing slash because I wasn't using the internal linking (@/) feature.

Would it make sense to always append a trailing slash for anything that looks like a URL / directory? Eg anything that does not have a file extension?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions