@@ -339,16 +339,6 @@ def on_page_context(self, context, *, page, config, nav):
339339 if view not in self ._resolve_views (self .blog ):
340340 return
341341
342- # If the current view is paginated, replace and rewire it - the current
343- # view temporarily becomes the main view, and is reset after rendering
344- assert isinstance (view , View )
345- if view != page :
346- prev = view .pages [view .pages .index (page ) - 1 ]
347-
348- # Replace previous page with current page
349- items = self ._resolve_siblings (view , nav )
350- items [items .index (prev )] = page
351-
352342 # Render excerpts and prepare pagination
353343 posts , pagination = self ._render (page )
354344
@@ -364,26 +354,6 @@ def pager(args: object):
364354 context ["posts" ] = posts
365355 context ["pagination" ] = pager if pagination else None
366356
367- # After rendering a paginated view, replace the URL of the paginated view
368- # with the URL of the original view - since we need to replace the original
369- # view with a paginated view in `on_page_context` for correct resolution of
370- # the active state, we must fix the paginated view URLs after rendering
371- def on_post_page (self , output , * , page , config ):
372- if not self .config .enabled :
373- return
374-
375- # Skip if page is not a view managed by this instance - this plugin has
376- # support for multiple instances, which is why this check is necessary
377- view = self ._resolve_original (page )
378- if view not in self ._resolve_views (self .blog ):
379- return
380-
381- # If the current view is paginated, replace the URL of the paginated
382- # view with the URL of the original view - see https://t.ly/Yeh-P
383- assert isinstance (view , View )
384- if view != page :
385- page .file .url = view .file .url
386-
387357 # Remove temporary directory on shutdown
388358 def on_shutdown (self ):
389359 rmtree (self .temp_dir )
0 commit comments