Skip to content

Commit

Permalink
Update Index.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoonahn authored Apr 18, 2024
1 parent 51a5820 commit 8f39b69
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Sources/Pages/Index.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ struct IndexPage: Component {
let context: PublishingContext<Blog>

var body: Component {
PageLayout(title: "Posts") {
ComponentGroup {
PostsLayout(items: context.paginatedItems[pageNumber-1], context: context)
Pagination(activePage: pageNumber, numberOfPages: context.paginatedItems.count) { num in
context.index.paginatedPath(pageIndex: num - 1).absoluteString
}
Section {
PostsLayout(items: context.paginatedItems[pageNumber-1], context: context)
Pagination(activePage: pageNumber, numberOfPages: context.paginatedItems.count) { num in
context.index.paginatedPath(pageIndex: num - 1).absoluteString
}
}
.class("px-4 sm:px-8 max-w-3xl mx-auto")
}
}

0 comments on commit 8f39b69

Please sign in to comment.