-
Notifications
You must be signed in to change notification settings - Fork 955
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
Undocumented or Faulty: linking colocated assets on a slug page through template #2598
Comments
I just ran into this as well. |
as far as I understood, get_url ( path, lang="en", trailing_slash=false, cachebust=false ) is also used internally which is why is simple and optimized. the function currently supposed to only work with MD files, not the page assets (even though the documentation suggests that). The function has a fallback option to also link to the static directory, and happens to work with un-sluggified content nodes too. It feels pretty alpha to me |
Basically it's for 2 things:
To handle 2 for assets with renamed slugs, it would require detecting it's a colocated asset, load the related page and generate the permalink from there (what you need to load exactly in the GetUrl fn is TBD, you don't want to add the whole site). |
Documentation issue
Summary
Listing all colocated assets of a page in a template
page.html
. The contentindex.md
uses a slug(tested on versions 0.18.0 and 0.19.1)
Files linked in markdown are unaffected.
file setup:
From the documentation:
If the page also uses a custom slug variable,
{{ get_url(path=asset) }}
doesn't provide this correctly,Zola will only display the right output when the link is written like:
Maybe I overlooked something, but linking all co-located assets seems to be quite essential for building almost any kind of art or photo gallery.
Proposed solution
Either current documentation should be expanded or get_url() should include this functionality.
The text was updated successfully, but these errors were encountered: