Get filepath (relative to src) from page? #650
Answered
by
oscarotero
writeblankspace
asked this question in
Q&A
-
I have a page called |
Beta Was this translation helpful? Give feedback.
Answered by
oscarotero
Aug 13, 2024
Replies: 1 comment 1 reply
-
You can create a preprocessor. site.preprocess([".md"], (pages) => {
for (const page of pages) {
const match = page.data.url.match(/*regular expression */);
if (match) {
const [, , year, month, day] = match;
page.data.date = new Date(year, month - 1, day, 0, 0, 0);
}
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
writeblankspace
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create a preprocessor.