DocumentationAmertaThemeUtilitiesBlogFunctions

Get Blog Posts By Tag

amerta


amerta / amerta/theme/utilities/blog / getBlogPostsByTag

Function: getBlogPostsByTag()

getBlogPostsByTag(limit): Promise<PaginatedDocs<Post>>

Defined in: amerta/theme/utilities/blog.ts:230

Retrieves blog posts filtered by a specific tag.

Parameters

| Parameter | Type | Description | | ------ | ------ | ------ | | limit | { limit?: number; locale?: string; page?: string; tag: string; } | Maximum number of posts to return per page. | | limit.limit? | number | - | | limit.locale? | string | - | | limit.page? | string | - | | limit.tag | string | - |

Returns

Promise<PaginatedDocs<Post>>

Paginated posts result filtered by tag.

Example

const posts = await getBlogPostsByTag({ limit: 10, page: "1", tag: "tag123", locale: "en" });