Skip to content

Commit

Permalink
fix: add pagination_next/prev to skip sidebar hidden pages in paginat…
Browse files Browse the repository at this point in the history
…ion too
  • Loading branch information
banasa44 committed Apr 16, 2024
1 parent 4b067dd commit 6ce8382
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/prune-subgraph-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,21 @@ fi
if ! line_exists "sidebar_class_name: hidden" "docs/subgraph/reference-guide/objects/query.mdx"; then
sed -i '2s/^/sidebar_class_name: hidden\n/' "docs/subgraph/reference-guide/objects/query.mdx"
fi

# Add pagination_next/pagination_previous to gracefully skip the previous sidbar hidden pages, to hide them from the
# nex/previous page buttons at the bottom of the webpages
if ! line_exists "pagination_prev: subgraph/reference-guide/index" "docs/subgraph/reference-guide/enums/permission-operation.mdx"; then
sed -i '2s#^#pagination_prev: subgraph/reference-guide/index\n#' "docs/subgraph/reference-guide/enums/permission-operation.mdx"
fi

if ! line_exists "pagination_next: subgraph/reference-guide/objects/standard-callback" "docs/subgraph/reference-guide/objects/plugin-version.mdx"; then
sed -i '2s#^#pagination_next: subgraph/reference-guide/objects/standard-callback\n#' "docs/subgraph/reference-guide/objects/plugin-version.mdx"
fi

if ! line_exists "pagination_prev: subgraph/reference-guide/objects/plugin-version" "docs/subgraph/reference-guide/objects/standard-callback.mdx"; then
sed -i '2s#^#pagination_prev: subgraph/reference-guide/objects/plugin-version\n#' "docs/subgraph/reference-guide/objects/standard-callback.mdx"
fi

if ! line_exists "pagination_next: null" "docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx"; then
sed -i '2s/^/pagination_next: null\n/' "docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx"
fi
1 change: 1 addition & 0 deletions static/subgraph/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Reference Guide [WIP]
sidebar_label: Reference Guide
pagination_next: subgraph/reference-guide/enums/permission-operation
---

## Subgraph
Expand Down

0 comments on commit 6ce8382

Please sign in to comment.