Skip to content

Commit

Permalink
Fixed further regression in blog plugin navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 4, 2023
1 parent 752aa5c commit 682d176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion material/plugins/blog/plugin.py
Expand Up @@ -343,8 +343,11 @@ def on_page_context(self, context, *, page, config, nav):
# view temporarily becomes the main view, and is reset after rendering
assert isinstance(view, View)
if view != page:
prev = view.pages[view.pages.index(page) - 1]

# Replace previous page with current page
items = self._resolve_siblings(view, nav)
items[items.index(view)] = page
items[items.index(prev)] = page

# Render excerpts and prepare pagination
posts, pagination = self._render(page)
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/blog/plugin.py
Expand Up @@ -343,8 +343,11 @@ def on_page_context(self, context, *, page, config, nav):
# view temporarily becomes the main view, and is reset after rendering
assert isinstance(view, View)
if view != page:
prev = view.pages[view.pages.index(page) - 1]

# Replace previous page with current page
items = self._resolve_siblings(view, nav)
items[items.index(view)] = page
items[items.index(prev)] = page

# Render excerpts and prepare pagination
posts, pagination = self._render(page)
Expand Down

0 comments on commit 682d176

Please sign in to comment.