Skip to content

Commit 0fa4912

Browse files
committed
Fix broken relative links in cookbook docs (Fix #2490)
Cookbook body links referenced sibling pages with a bare slug (e.g. `c14-keep-alive`). Under the pretty-URL layout each page lives in its own directory, so these resolve against the page's own directory and 404. Prefix them with `../` to match the convention already used in the tour and llm-app sections. Verified clean with `docs-gen check`.
1 parent 32abac3 commit 0fa4912

80 files changed

Lines changed: 112 additions & 112 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs-src/pages/en/cookbook/c01-get-response-body.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ Return `false` from the callback to abort the download. In the example above, if
5757
>
5858
> The `ResponseHandler` is called after headers arrive but before the body. Return `false` to skip the download entirely.
5959
60-
> To show download progress, see [C11. Use the progress callback](c11-progress-callback).
60+
> To show download progress, see [C11. Use the progress callback](../c11-progress-callback).

docs-src/pages/en/cookbook/c02-json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ if (res && res->status == 200) {
3131

3232
`res->body` is a `std::string`, so you can pass it straight to your JSON library.
3333

34-
> **Note:** Servers sometimes return HTML on errors. Check the status code before parsing to be safe. Some APIs also require an `Accept: application/json` header. If you're calling a JSON API repeatedly, [C03. Set default headers](c03-default-headers) can save you some boilerplate.
34+
> **Note:** Servers sometimes return HTML on errors. Check the status code before parsing to be safe. Some APIs also require an `Accept: application/json` header. If you're calling a JSON API repeatedly, [C03. Set default headers](../c03-default-headers) can save you some boilerplate.
3535
36-
> For how to receive and return JSON on the server side, see [S02. Receive JSON requests and return JSON responses](s02-json-api).
36+
> For how to receive and return JSON on the server side, see [S02. Receive JSON requests and return JSON responses](../s02-json-api).

docs-src/pages/en/cookbook/c03-default-headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ auto res = cli.Get("/users", headers);
5252

5353
Per-request headers are **added** on top of the defaults. Both are sent to the server.
5454

55-
> For details on Bearer token auth, see [C06. Call an API with a Bearer token](c06-bearer-token).
55+
> For details on Bearer token auth, see [C06. Call an API with a Bearer token](../c06-bearer-token).

docs-src/pages/en/cookbook/c04-follow-location.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Many sites redirect HTTP traffic to HTTPS. With `set_follow_location(true)` on,
3535

3636
> **Warning:** To follow redirects to HTTPS, you need to build cpp-httplib with OpenSSL (or another TLS backend). Without TLS support, redirects to HTTPS will fail.
3737
38-
> **Note:** Following redirects adds to the total request time. See [C12. Set timeouts](c12-timeouts) for timeout configuration.
38+
> **Note:** Following redirects adds to the total request time. See [C12. Set timeouts](../c12-timeouts) for timeout configuration.

docs-src/pages/en/cookbook/c05-basic-auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ For the more secure Digest authentication scheme, use `set_digest_auth()`. This
4343
cli.set_digest_auth("alice", "s3cret");
4444
```
4545

46-
> To call an API with a Bearer token, see [C06. Call an API with a Bearer token](c06-bearer-token).
46+
> To call an API with a Bearer token, see [C06. Call an API with a Bearer token](../c06-bearer-token).

docs-src/pages/en/cookbook/c06-bearer-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ if (res && res->status == 401) {
4747

4848
> **Warning:** A Bearer token is itself a credential. Always send it over HTTPS, and never hard-code it into source or config files.
4949
50-
> To set multiple headers at once, see [C03. Set default headers](c03-default-headers).
50+
> To set multiple headers at once, see [C03. Set default headers](../c03-default-headers).

docs-src/pages/en/cookbook/c07-multipart-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ The arguments to `make_file_provider()` are `(form name, file path, file name, c
4949

5050
> **Note:** You can mix `UploadFormDataItems` and `FormDataProviderItems` in the same request. A clean split is: text fields in `UploadFormDataItems`, files in `FormDataProviderItems`.
5151
52-
> To show upload progress, see [C11. Use the progress callback](c11-progress-callback).
52+
> To show upload progress, see [C11. Use the progress callback](../c11-progress-callback).

docs-src/pages/en/cookbook/c08-post-file-body.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ If the file can't be opened, `make_file_body()` returns `size` as `0` and `provi
3131
3232
> **Warning:** `make_file_body()` needs to fix the Content-Length up front, so it reads the file size ahead of time. If the file size might change mid-upload, this API isn't the right fit.
3333
34-
> To send the file as multipart form data instead, see [C07. Upload a file as multipart form data](c07-multipart-upload).
34+
> To send the file as multipart form data instead, see [C07. Upload a file as multipart form data](../c07-multipart-upload).

docs-src/pages/en/cookbook/c09-chunked-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ With a known size, the request carries a Content-Length header — so the server
4444

4545
> **Detail:** `sink.write()` returns a `bool` indicating whether the write succeeded. If it returns `false`, the connection is gone — return `false` from the lambda to stop.
4646
47-
> If you're just sending a file, `make_file_body()` is easier. See [C08. POST a file as raw binary](c08-post-file-body).
47+
> If you're just sending a file, `make_file_body()` is easier. See [C08. POST a file as raw binary](../c08-post-file-body).

docs-src/pages/en/cookbook/c10-stream-response.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ Accumulate into a buffer, then pull out and parse one line each time you see a n
4848

4949
> **Warning:** When you pass a `ContentReceiver`, `res->body` stays **empty**. Store or process the body inside the callback yourself.
5050
51-
> To track download progress, combine this with [C11. Use the progress callback](c11-progress-callback).
52-
> For Server-Sent Events (SSE), see [E04. Receive SSE on the client](e04-sse-client).
51+
> To track download progress, combine this with [C11. Use the progress callback](../c11-progress-callback).
52+
> For Server-Sent Events (SSE), see [E04. Receive SSE on the client](../e04-sse-client).

0 commit comments

Comments
 (0)