-
Hi, First, congrats for this super cool generator! I'm trying to replicate what I read from Josh Comeau here with the Thank you 😃 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
UPDATE: You can now Hi Julien! 😃
This part can be achieved using glob imports, as in the blog example: const allPosts = import.meta.globEagerDefault('../pages/posts/**/*.{md,mdx}') To get the latest, you can sort them by date. If you use For the popular part, you could use Currently îles does not polyfill |
Beta Was this translation helpful? Give feedback.
UPDATE: You can now
useDocuments('~/posts')
.Hi Julien! 😃
This part can be achieved using glob imports, as in the blog example:
To get the latest, you can sort them by date. If you use
date
in frontmatter, have in mind that YAML supports Date objects so that you don't have to manually donew Date
.For the popular part, you could use
fetch
, query any APIs as needed to obtain the names or hrefs of the posts, and then pick the top 5 or sort them accordingly.Currently îles does not polyfill
fetch
during SSG, but…