Skip to content
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

load_data appears to always try to load a local file #1753

Closed
piedoom opened this issue Feb 8, 2022 · 2 comments
Closed

load_data appears to always try to load a local file #1753

piedoom opened this issue Feb 8, 2022 · 2 comments

Comments

@piedoom
Copy link
Contributor

piedoom commented Feb 8, 2022

Bug Report

Environment

Windows, GH Actions

Zola version: 0.15.3 (appears to affect 14.1, haven't tested earlier)

Expected Behavior

This should request "https://en.wikipedia.org/wiki/Commune_of_Paris" (and deserialize it if it is a specific filetype)

{% set data = load_data(path="https://en.wikipedia.org/wiki/Commune_of_Paris") %}

Current Behavior

It appears the URL is always appended to the local path, e.g.

Reason: Function call 'load_data' failed
Reason: `load_data`: /github/workspace/https://vaporsoft.net/feed.toml doesn't exist

Step to reproduce

Use any load_data fn with an external URL

@Keats
Copy link
Collaborator

Keats commented Feb 8, 2022

Ah the docs are wrong :(
Try {% set data = load_data(url="https://en.wikipedia.org/wiki/Commune_of_Paris") %}, path is only meant to be used for local files.

Keats pushed a commit that referenced this issue Feb 10, 2022
@piedoom piedoom closed this as completed Feb 12, 2022
thomasantony pushed a commit to thomasantony/zola that referenced this issue Sep 17, 2022
@Jieiku
Copy link
Contributor

Jieiku commented Sep 19, 2023

Here is an example of using it as a shortcode:

{{ showdata(src="../theme.toml" type="toml" key="min_version") }}
https://github.com/Jieiku/abridge/blob/master/templates/shortcodes/showdata.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants