-
Hi again! Second time I'm reporting in with something I need to wrap my head around—though at least this time I'm sure it's just a skill issue on my part. So, first off, I'm a coding newbie making a site with a blog (the framework for which can be seen here for the moment https://github.com/robocone/blog-test/tree/main ), and I want to have something in As for how I'd be able to go about doing that, I know three things:
to actually display the data. What I don't know is what exactly that function would look like within my code (for the by-date display and limitation to a specific number of posts displayed especially)—so help fleshing that out/filling in my blanks, so-to-speak, would be appreciated. And on a tangentially related note, I anticipated that to keep things neat (especially if I decided to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Okay, so...after revisiting this, somehow that second issue (the ...However, when trying to place the function for said list into a specific div (via
Becomes this:
In any instance the .njk file is slotted in. I'm guessing this has to do with either the order in which eleventy processes .njk files specifically, or just a pathing issue that ruins the function—but any pointers would be nice! |
Beta Was this translation helpful? Give feedback.
As for top n posts, I'd probably use a custom filter to slice an array:
Or you can see a slightly better version in the eleventy-base-blog at https://github.com/11ty/eleventy-base-blog/blob/d78b03ae1d059a8e69941e49fa0214595bcf828d/eleventy.config.js#L51-L61