2024-11
def load_and_resolve_includes(fname: Path):
fname = fname.resolve() # resolve to abspath without symlink
with open(fname, "r") as f:
text = f.read()
# # remove comments first; else commented out input will come in.
text = Scanner(text).remove_comments()
text = Scanner(text).resolve_includes_recursively(fname.parent)
return text
export async function getStaticPaths() {
const blogs = get_all_blogs()
// const blogs = []
// Get the paths we want to pre-render based on posts
const paths = blogs.map((props) => ({
params: {url: props.url},
}))
// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
return { paths, fallback: false }
}
Last updated on 2024-04-03. Design inspired by distill.