You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a shortcode which includes a syntax-highlighted code from a file. I'm using the new colocation feature.
My shortcode currently looks like this:
{% set text = load_data(path=path, format="plain") -%}
{% set file_name = path | split(pat="/") | last -%}
```{{ language }}
{{ text }}
```
(Download the source code for this example: [here]({{ file_name }})
Given that file content/lessons/4_enums/enums.rs exists, in content/lessons/4_enums/index.md I write
It may be related (because of colocation), so I'll ask the question here:
it appears that you cannot use get_url with colocated resources.
In the example above get_url(path="content/lessons/4_enums/index.md") works, but get_url(path="content/lessons/4_enums/enums.rs") does not
I'm trying to write a shortcode which includes a syntax-highlighted code from a file. I'm using the new colocation feature.
My shortcode currently looks like this:
Given that file
content/lessons/4_enums/enums.rs
exists, incontent/lessons/4_enums/index.md
I writeIdeally I'd like to be able to write
I think for that it would be necessary to provide the path of the file from which the shortcode was invoked.
Unless there is some other way to achieve that, I would be happy to implement the change myself if you provide some guidance.
The text was updated successfully, but these errors were encountered: