wip post
This commit is contained in:
parent
c8a2913172
commit
5a1c98d8a4
8 changed files with 170 additions and 0 deletions
10
templates/macros/colocated_asset.html
Normal file
10
templates/macros/colocated_asset.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!--
|
||||
Returns the file path of the colocated asset.
|
||||
When Zola uses `resize_image` it looks relative to the `content` folder.
|
||||
This means you have to reference the full page asset colocation path.
|
||||
-->
|
||||
{%- macro colocated_asset(path) -%}
|
||||
{%- set page_url_components = page.relative_path | default(value=section.relative_path) | split(pat='/') -%}
|
||||
{%- set page_base = page_url_components | slice(end=page_url_components | length - 1) | join(sep='/') -%}
|
||||
{{ page_base ~ '/' ~ path }}
|
||||
{%- endmacro colocated_asset -%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue