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

Url as function throws error in shared data file #105

Closed
bradeneast opened this issue Jun 18, 2021 · 1 comment
Closed

Url as function throws error in shared data file #105

bradeneast opened this issue Jun 18, 2021 · 1 comment

Comments

@bradeneast
Copy link

I'm trying to use a url as function for pages in a certain directory (as shown in the example here).

This is the code in my _data.js file.

export const type = "shoot";
export const layout = "layouts/shoot.njk";

export function url(page) {
  return `./${page.data.title}/`
}

This is giving me the error shown below.

Error: The url variable must start with "/", "./" or "../"      
page: \shoots\good-boy-plays-with-toy.md
url: ./Good Boy plays with toy/

I have been using the slugifyUrls plugin, but enabling/disabling it did not resolve the error. It only happens when using the url as function export from _data.js in that folder

oscarotero pushed a commit that referenced this issue Jun 18, 2021
@oscarotero
Copy link
Member

Hi. Thanks for reporting this.
I've published the patch v0.23.2. Just run deno upgrade and it should work fine now.

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

No branches or pull requests

2 participants