From dd6457e8e7909a647db10f8e4391c53ec14c2878 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Sun, 13 Oct 2024 13:10:03 +0200 Subject: [PATCH] fix(docs): handle prev and next buttons on the bottom correctly in presence of sidebar separator items --- CHANGELOG.md | 1 + docs/astro.config.mjs | 27 ++++++++++++------- docs/src/content/docs/book/deploy.mdx | 3 +++ docs/src/content/docs/book/operators.mdx | 3 +++ docs/src/content/docs/book/receive.mdx | 3 +++ docs/src/content/docs/book/types.mdx | 3 +++ .../docs/cookbook/multi-communication.mdx | 3 +++ .../docs/cookbook/single-communication.mdx | 5 +++- .../src/content/docs/ecosystem/typescript.mdx | 3 +++ docs/src/content/docs/ref/core-base.mdx | 3 +++ .../content/docs/ref/standard-libraries.mdx | 3 +++ 11 files changed, 47 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0432d1706..8712e6191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Docs: layout of tables, syntax highlighting, Chinese translations of sidebar separators: PR [#916](https://github.com/tact-lang/tact/pull/916) - Non-null struct fields after null ones are treated correctly in Sandbox tests after updating `@ton/core` to 0.59.0: PR [#933](https://github.com/tact-lang/tact/pull/933) - Prevent inline code snippets from changing their background color: PR [#935](https://github.com/tact-lang/tact/pull/935) +- Docs: correctly handle next and previous page links at the bottom of the pages when there's a separator item in the sidebar: PR [#949](https://github.com/tact-lang/tact/pull/949) ### Release contributors diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 3a5f56552..30d746bf8 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -137,7 +137,8 @@ export default defineConfig({ { label: 'Fundamentals of Tact', translations: { 'zh-CN': 'Tact 语言基础' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'book/types#', }, { slug: 'book/types' }, { slug: 'book/integers' }, @@ -150,7 +151,8 @@ export default defineConfig({ { label: 'Expressiveness', translations: { 'zh-CN': '表现力' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'book/operators#', }, { slug: 'book/operators' }, { slug: 'book/expressions' }, @@ -160,7 +162,8 @@ export default defineConfig({ { label: 'Communication', translations: { 'zh-CN': '交流' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'book/receive#', }, { slug: 'book/receive' }, { slug: 'book/bounced' }, @@ -171,7 +174,8 @@ export default defineConfig({ { label: 'Going places', translations: { 'zh-CN': '前往各地' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'book/deploy#', }, { slug: 'book/deploy' }, { slug: 'book/debug' }, @@ -193,7 +197,8 @@ export default defineConfig({ { label: 'Single contract', translations: { 'zh-CN': '单一合同' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'cookbook/single-communication#', }, { slug: 'cookbook/single-communication' }, { slug: 'cookbook/type-conversion' }, @@ -206,7 +211,8 @@ export default defineConfig({ { label: 'Multiple contracts', translations: { 'zh-CN': '多重合同' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'cookbook/multi-communication#', }, { slug: 'cookbook/multi-communication' }, { slug: 'cookbook/jettons' }, @@ -240,7 +246,8 @@ export default defineConfig({ { label: 'Core library', translations: { 'zh-CN': '核心图书馆' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'ref/core-base#', }, { slug: 'ref/core-base' }, { slug: 'ref/core-common' }, @@ -254,7 +261,8 @@ export default defineConfig({ { label: 'Standard libraries', translations: { 'zh-CN': '标准图书馆' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'ref/standard-libraries#', }, { slug: 'ref/standard-libraries' }, { slug: 'ref/stdlib-config' }, @@ -275,7 +283,8 @@ export default defineConfig({ { label: 'Tools', translations: { 'zh-CN': '工具' }, - link: '#', attrs: { class: 'sidebar-separator' } + attrs: { class: 'sidebar-separator' }, + link: 'ecosystem/typescript#', }, { slug: 'ecosystem/typescript' }, { slug: 'ecosystem/vscode' }, diff --git a/docs/src/content/docs/book/deploy.mdx b/docs/src/content/docs/book/deploy.mdx index 23c0573e6..92b5ba397 100644 --- a/docs/src/content/docs/book/deploy.mdx +++ b/docs/src/content/docs/book/deploy.mdx @@ -1,6 +1,9 @@ --- title: Deployment description: "Common ways to deploy Tact contracts to testnet or mainnet of TON Blockchain" +prev: + link: /book/message-mode + label: Message mode --- Tact Deployer is a small library that integrates with [TON Verifier](https://verifier.ton.org) that allows you to deploy your contracts safely using your favorite wallet without needing to manage keys or deploy contracts manually. Tact Deployer also automatically verifies your contract's source code and you can be sure that your compiler is not compromised. diff --git a/docs/src/content/docs/book/operators.mdx b/docs/src/content/docs/book/operators.mdx index 98c16a045..b6b3d6a8e 100644 --- a/docs/src/content/docs/book/operators.mdx +++ b/docs/src/content/docs/book/operators.mdx @@ -1,6 +1,9 @@ --- title: Operators description: "This page lists all the operators in Tact in decreasing order of their precedence, with examples of usage" +prev: + link: /book/exit-codes + label: Exit codes --- Almost every contract operates on data: transforms some values into another. Scope may vary, but operators lay in core of such modifications. diff --git a/docs/src/content/docs/book/receive.mdx b/docs/src/content/docs/book/receive.mdx index ee6160eb5..d9469f8fd 100644 --- a/docs/src/content/docs/book/receive.mdx +++ b/docs/src/content/docs/book/receive.mdx @@ -1,6 +1,9 @@ --- title: Receive messages description: "The most common type of messages is the internal message - a message sent from one contract to another" +prev: + link: /book/functions + label: Functions --- TON is a distributed blockchain which means that communication between contracts is done by sending and receiving messages. The most common type of messages is the internal message - a message sent from one contract (or a wallet) to another. diff --git a/docs/src/content/docs/book/types.mdx b/docs/src/content/docs/book/types.mdx index e3d398600..234b33441 100644 --- a/docs/src/content/docs/book/types.mdx +++ b/docs/src/content/docs/book/types.mdx @@ -1,6 +1,9 @@ --- title: Type system overview description: "Every variable, item, and value in Tact programs has a type" +prev: + link: /book/cs/from-solidity + label: Coming from Solidity --- Every variable, item, and value in Tact programs has a type. They can be: diff --git a/docs/src/content/docs/cookbook/multi-communication.mdx b/docs/src/content/docs/cookbook/multi-communication.mdx index 81aacf77c..1e1697f8b 100644 --- a/docs/src/content/docs/cookbook/multi-communication.mdx +++ b/docs/src/content/docs/cookbook/multi-communication.mdx @@ -1,6 +1,9 @@ --- title: Multi-contract communication description: "Common examples of communication between many deployed contracts on blockchain" +prev: + link: /cookbook/misc + label: Miscellaneous --- :::danger[Not implemented] diff --git a/docs/src/content/docs/cookbook/single-communication.mdx b/docs/src/content/docs/cookbook/single-communication.mdx index 72faec06f..8b53d9a3e 100644 --- a/docs/src/content/docs/cookbook/single-communication.mdx +++ b/docs/src/content/docs/cookbook/single-communication.mdx @@ -1,6 +1,9 @@ --- -title: Single-contract Communication +title: Single-contract communication description: "Common examples of communication of a single deployed contract with other contracts on blockchain" +prev: + link: /cookbook + label: Cookbook overview --- This page lists examples of communication of a single deployed contract with other contracts on blockchain. diff --git a/docs/src/content/docs/ecosystem/typescript.mdx b/docs/src/content/docs/ecosystem/typescript.mdx index 242e7306f..b1d394d02 100644 --- a/docs/src/content/docs/ecosystem/typescript.mdx +++ b/docs/src/content/docs/ecosystem/typescript.mdx @@ -1,6 +1,9 @@ --- title: TypeScript libraries description: "The compiler of Tact automatically generates wrapper code for use with @ton/ton and @ton/core libraries" +prev: + link: /ecosystem + label: Ecosystem overview --- The Tact language has built-in support for the [@ton/ton](https://github.com/ton-org/ton) and [@ton/core](https://github.com/ton-org/ton-core) TypeScript libraries. The compiler automatically generates code for these libraries, so you can use [@tact-lang/emulator](https://github.com/tact-lang/tact-emulator) or [@ton/sandbox](https://github.com/ton-org/sandbox), that work on top of them. diff --git a/docs/src/content/docs/ref/core-base.mdx b/docs/src/content/docs/ref/core-base.mdx index c8def1b4f..8ccfbfe2e 100644 --- a/docs/src/content/docs/ref/core-base.mdx +++ b/docs/src/content/docs/ref/core-base.mdx @@ -1,6 +1,9 @@ --- title: Base trait description: "Every contract and trait in Tact implicitly inherits the BaseTrait trait" +prev: + link: /ref/evolution/otp-006 + label: "OTP-006: Contract Package" --- Every [contract](/book/contracts) and [trait](/book/types#traits) in Tact implicitly [inherits](/book/contracts#traits) the `BaseTrait{:tact}` trait, which contains a number of the most useful [internal functions](/book/contracts#internal-functions) for any kind of contract, and a constant `self.storageReserve{:tact}` aimed at advanced users of Tact. diff --git a/docs/src/content/docs/ref/standard-libraries.mdx b/docs/src/content/docs/ref/standard-libraries.mdx index b8e8289af..2659c3379 100644 --- a/docs/src/content/docs/ref/standard-libraries.mdx +++ b/docs/src/content/docs/ref/standard-libraries.mdx @@ -1,6 +1,9 @@ --- title: Standard libraries overview description: "Some libraries come bundled with Tact compiler, but aren't automatically included to your project until explicitly made to" +prev: + link: /ref/core-advanced + label: Advanced --- Some libraries (also referred to as standard libraries or stdlibs) come bundled with Tact compiler, but aren't automatically included to your project until explicitly made to.