DocumentationAmertaThemeUtilitiesBlogFunctions
Get Blog Posts
amerta / amerta/theme/utilities/blog / getBlogPosts
Function: getBlogPosts()
getBlogPosts(
limit):Promise<PaginatedDocs<Post>>
Defined in: amerta/theme/utilities/blog.ts:37
Retrieves a paginated list of published blog posts.
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| limit | { filter?: Record<string, any>; limit?: number; locale?: string; page?: string; sort?: string; } | Maximum number of posts to return per page. |
| limit.filter? | Record<string, any> | - |
| limit.limit? | number | - |
| limit.locale? | string | - |
| limit.page? | string | - |
| limit.sort? | string | - |
Returns
Promise<PaginatedDocs<Post>>
Paginated posts result.
Example
const posts = await getBlogPosts({ limit: 10, page: "1", locale: "en" });