Post List

Post List

Creating posts list page

It's very common to display a list of top/latest posts as a blog home page. Our doc-site blog feature helps you to create your favorite blog posts list home page.

It's very simple to create your top/latest featured posts using -- ds.posts which can be added inside -- ds.page.

Let's learn how to create it.
Example of how to use -- ds.posts
-- import: fastn-community.github.io/doc-site/blog-articles/category-1/sample-post-1
-- import: fastn-community.github.io/doc-site/blog-articles/category-1/sample-post-2 
-- import: fastn-community.github.io/doc-site/blog-articles/category-2/sample-post-3 
-- import: fastn-community.github.io/doc-site/blog-articles/category-2/sample-post-4

-- ds.page:

-- ds.posts:

-- ds.featured-post:
post-data: $sample-post-2.meta

-- ds.image-first:
post-data: $sample-post-1.meta

-- ds.image-in-between:
post-data: $sample-post-3.meta

-- ds.without-image:
post-data: $sample-post-4.meta

-- ds.image-first:
post-data: $sample-post-1.meta

-- ds.image-in-between:
post-data: $sample-post-3.meta

-- end: ds.posts

-- end: ds.page
post-list.ftd
Lang:
ftd

Let's understand above code snippet:

Importing blog posts meta with import
-- ds.page:
Learn more: ds.page
-- ds.posts:
Learn more: posts
-- ds.featured-post:
Learn more: featured-post
-- ds.image-first:
Learn more: image-first
-- ds.image-in-between
Learn more: image-in-between
-- ds.without-image:
Learn more: ds.without-image
Copyright © 2023 - FifthTry