Processing subfolder/*.{html, njk, tmpl.js} #361
-
Is there a way to process all pages in certain folder? export default page => `<head>${page.document.scripts
.forEach(el => `<script async href="${el.href}>"`)
}</head>` |
Beta Was this translation helpful? Give feedback.
Answered by
oscarotero
Jan 15, 2023
Replies: 1 comment
-
You can process all pages with site.process("*", (page) => {
if (page.src.path.startsWith("/subfolder/") && page.src.ext === ".njk") {
runMyProcessor(page);
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DrSensor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can process all pages with
*
and use a condition to apply the processor to certain pages only. For example: