Blogs

Blog Search

Purpose

  • Enables users to search and view blogs filtered by tags, categories, or search keywords. Useful for tag-based navigation and full-text search.

Core Features

  • Filter Sources
    • ?q= β†’ free-text search
    • ?tag= β†’ tag-based filter
    • ?category= β†’ category-based filter
  • Search Bar
    • Two-way bound to selectedQuery
    • Enter key or search icon triggers redirect to search URL
    • Clear icon (TsIcon) resets the input and navigates back to /blogs
  • Pagination
    • 6 blogs per page.
    • Uses client-side slicing for paginated rendering

Logic Flow

  • On load or query change:
    • Triggers fetchBlogs() using:
      • Regex for title if q
      • Tag match if tag
      • Category match if category
    • Updates the list from builderStore.blogs
    • Slices results to current page window

Component Used

ComponentDescription
TsInputSearch input field
TsAlertResult count banner
TsBlogCardBlog preview cards
TsPaginationPage navigation
TsGrid, TsRowGrid-based responsive layout

Developer Notes

  • Tips for Extending
    • Debounce Search Input: Add debounce on the input field to avoid multiple fetch calls.
    • Server-Side Search (Optional): For performance, search could be offloaded to a server or use ElasticSearch.
    • Read Time Calculation: Can be re-enabled and enhanced for better UX.
    • i18n Readiness: Strings use useTranslation()β€”ensure keys are fully mapped for new locales.

Performance & SEO

FeatureImplementation
Lazy Loading ComponentsdefineAsyncComponent() used extensively
Metadata / SEOuseHead() with dynamic values
Schema MarkupgenerateSchemaList, generateContentSchema
Responsive layoutTsGrid, TsRow, and TsColumn
Client-side paginationFast navigation with minimal load

Data Management

  • builderStore
  • Central store that handles:
    • getBlogList(type, filters, sort) β†’ Fetch blog list
    • getBlogItem(type, filter) β†’ Fetch individual blog
    • Stores blogs and current blog in reactive state
    • Manages redirection helpers for filters and search

Copyright Β© 2026