Skip to content

Process filename on render? #509

Closed Answered by oscarotero
allanberry asked this question in Q&A
Discussion options

You must be logged in to vote

To include the version in the url, you can use the url function. For example, create _data.js file in the folder containing the files do you want to rewrite:

// my-files/_data.js

const version = "v1.2.3";

export function url(page) {
  return `./${page.src.slug}${version}${page.src.ext}`
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by allanberry
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants