-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite scroll SEO #6598
base: develop
Are you sure you want to change the base?
Infinite scroll SEO #6598
Conversation
Add a "Load more" button in the bottom to help search engine bots to navigate to the next page. In order to debug this functionality, add ?finiteScroll=true to the URL.
hasMoreItems has to be called before bumping the current page in order to work accordingly.
cfe81c1
to
ad1d2d6
Compare
ad1d2d6
to
b620bea
Compare
if (!hasMoreItems(this.pagination)) return | ||
if (!hasMoreItems(this.pagination)) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return | ||
if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
search: string | ||
|
||
constructor ( | ||
private userSubscriptionService: UserSubscriptionService, | ||
private notifier: Notifier | ||
) {} | ||
) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return | ||
if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
this.pagination.totalItems = null | ||
this.pagination.currentPage = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
@@ -152,7 +153,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy { | |||
private route: ActivatedRoute, | |||
private screenService: ScreenService, | |||
private peertubeRouter: PeerTubeRouterService, | |||
private serverService: ServerService | |||
private serverService: ServerService, | |||
public router: Router |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used?
if (this.lastQueryLength !== undefined && this.lastQueryLength < this.pagination.itemsPerPage) return | ||
if (this.lastQueryLength !== undefined && this.lastQueryLength < this.pagination.itemsPerPage) { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
if (hasMoreItems(this.componentPagination)) { | ||
this.loadNotifications() | ||
} | ||
|
||
this.componentPagination.currentPage++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be at line 89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -15,7 +15,6 @@ import { PageHtml } from './page-html.js' | |||
import { TagsHtml } from './tags-html.js' | |||
|
|||
export class VideoHtml { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
@Chocobozzz I did a self-review and found some minor style changes. If you're okay with this implementation I'll fix them. |
Description
Adds a "Load more" button on the bottom of MyInfiniteScrollerComponent. For a regular user the behavior should be the same.
Behavior for bots:
page?{currentPage++}
Background
Thoughts during the path
Todo
Related issues
#6332
Has this been tested?
To test it manually, add a "?page=1" query param to a route which has infinite scroll
Screenshots