Flutter-Bounty-Hunters / static_shock

A static site generator for Dart.
MIT License
59 stars 5 forks source link

[Shock] - Support pagination and page generation #68

Open matthew-carroll opened 6 months ago

matthew-carroll commented 6 months ago

Add a plugin that searches for pages like the search plugin, but also groups the response into a list of lists of pages.

Something like:

class Paginator {
  int get totalResultsCount;
  int get resultsPerPage;
  int get pageCount;

  List<PaginatedResults> getPage(int index);
}

class PaginatedResults {
  int get startIndex;
  int get endIndex;
  int get pageSize;

  Page get page;

  PaginatedResults? get nextPage;
  PaginatedResults? get previousPage;
}

For this work to be useful, this pagination system also needs to include support for generated pages, so that a listing page can be generated for each group of pages that are paginated, e.g., myblog.com/posts/page-1, myblog.com/posts/page-2, etc.