Skip to content

Commit 2201eba

Browse files
Merge pull request #59 from openfoodfacts/fix-index-links
doc: fix index links
2 parents 51de593 + 4297e52 commit 2201eba

File tree

9 files changed

+15
-13
lines changed

9 files changed

+15
-13
lines changed

.github/workflows/update-dev-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ jobs:
197197
# Change internal links from .md extension to directory format for the docs site
198198
# e.g., /docs/Product-Opener/dev/how-to-develop-using-docker.md -> /docs/Product-Opener/dev/how-to-develop-using-docker/
199199
# Works with any link ending in .md that doesn't contain :// (excludes http/https)
200-
find content/docs -name "*.mdx" -exec sed -i '/:\/\//! s|\([^)]*\)\.md|\1/|g' {} \;
200+
# Special handling for /index.md to end in /
201+
find content/docs -name "*.mdx" -exec sed -i '/:\/\//! s|/index\.md|/|g; s|\([^)]*\)\.md|\1/|g' {} \;
201202
echo "Internal links fixed"
202203
203204
- name: Copy documentation assets

content/docs/Product-Opener/(api)/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Welcome to the Product Opener API documentation.
99

1010
## Schemas
1111

12-
- **[Schemas](schemas/schemas/)** - API schema definitions for the last version of the API
12+
- **[Schemas](schemas/schemas/)** - API schema definitions for the latest version of the API
1313
- **[API and Product Schema Change Log](../api/ref-api-and-product-schema-change-log/)** - Reference for API and product schema changes
1414

1515
## API Versions
1616

17-
- **[V2 API](v2/)** - Legacy API endpoints
18-
- **[V3 API](v3/)** - Current API endpoints
17+
- **v2 API** - Legacy API endpoints
18+
- **v3 API** - Current API endpoints

content/docs/Product-Opener/(docs)/api/tutorial-off-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Tutorial on using the Open Food Facts API"
44

55
Welcome to this tutorial on basic usage of Open Food Facts API.
66

7-
First, be sure to see our [Introduction to the API](./index/).
7+
First, be sure to see our [Introduction to the API](./).
88

99
## Scan A Product To Get Nutri-score
1010

content/docs/Product-Opener/(docs)/api/tutorial-uploading-photo-to-a-product.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Tutorial on uploading images to the Open Food Facts API"
44

55
This basic tutorial shows you how to upload an image of a product to the Open Food Facts API.
66

7-
Be sure to also read the [introduction to the API](./index/)
7+
Be sure to also read the [introduction to the API](./)
88

99
## Points to consider before uploading photos
1010

@@ -43,7 +43,7 @@ Multilingual products have several photos based on the languages present on the
4343
The WRITE operations in the Open Food Facts API require authentication. Therefore you need a valid `user_id`^[user_id_not_email] and `password` to write the photo to 100% Real Orange Juice.
4444

4545
> Sign up on the [Open Food Facts App](https://world.openfoodfacts.org/) to get your `user_id` and `password` if you dont have one.
46-
For more details, visit the : [Authentication paragraph in our introduction](../index/#authentication).
46+
For more details, visit the : [Authentication paragraph in our introduction](../#authentication).
4747

4848
^[user_id_not_email]: user_id is the username of your account. You must not use your email address.
4949

content/docs/Product-Opener/(docs)/api/tutorials/adding-missing-products.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you have an app that makes POST calls and you don't want your users to authen
1313
- `user_id`: myappname
1414
- `password`: 123456
1515

16-
* For a complete reference on AUTH, please read: [Authentication in our introduction](../index/#authentication)
16+
* For a complete reference on AUTH, please read: [Authentication in our introduction](../#authentication)
1717

1818
---
1919

content/docs/Product-Opener/(docs)/dev/how-to-develop-producer-platform.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Now, the public database can be accessed at `openfoodfacts.localhost`.If you nee
3737

3838
Note that if you [use direnv](how-to-use-direnv/), the setup should work seamlessly without redefining the variables set by `setenv.sh`.
3939

40-
An explanation of the setup can be found at [explain-pro-dev-setup.md](explain-pro-dev-setup/)
40+
An explanation of the setup can be found at [explain-pro-dev-setup/](explain-pro-dev-setup/)
4141

4242
- If you want to see the state of tasks, you can run:
4343

content/docs/Product-Opener/(docs)/dev/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Introduction to Product Opener developer documentation"
44

55
This documentation is for developers who wants to understand technical aspects of Product Opener.
66

7-
To use the API, see [API Documentation](../api/index/)
7+
To use the API, see [API Documentation](../api/)
88

99
The repository for the project is at https://github.com/openfoodfacts/openfoodfacts-server/
1010

content/docs/Product-Opener/(docs)/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Welcome to the documentation of **Product Opener**, the web server at the heart
66

77
It also powers the sibling **Open \[[Beauty](https://world.openbeautyfacts.org/)|[Pet Food](https://world.openpetfoodfacts.org/)|[Products](https://world.openproductsfacts.org/)\] Facts** projects
88

9-
* If you want to use the API or are interested in the data, look at [API documentation](api/index/) and [Events documentation](./events/README/)
9+
* If you want to use the API or are interested in the data, look at [API documentation](api/) and [Events documentation](./events/README/)
1010

11-
* If you are a developer, look at [Developer documentation](dev/index/)
11+
* If you are a developer, look at [Developer documentation](dev/)
1212

1313
The repository for the project is at https://github.com/openfoodfacts/openfoodfacts-server/
1414

scripts/generate-docs.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,5 @@ execSync("find content/docs -name '*.mdx' -exec sed -i 's/^``` \\+\\(\\w\\+=.\\+
172172
// Change internal links from .md extension to directory format for the docs site
173173
// e.g., /docs/Product-Opener/dev/how-to-develop-using-docker.md -> /docs/Product-Opener/dev/how-to-develop-using-docker/
174174
// Works with any link ending in .md that doesn't contain :// (excludes http/https)
175-
execSync("find content/docs -name '*.mdx' -exec sed -i '/:\\/\\/\\//! s|\\([^)]*\\)\\.md|\\1/|g' {} \\;", { stdio: 'inherit' });
175+
// Special handling for /index.md to end in /
176+
execSync("find content/docs -name '*.mdx' -exec sed -i '/:\\/\\/\\//! s|/index\\.md|/|g; s|\\([^)]*\\)\\.md|\\1/|g' {} \\;", { stdio: 'inherit' });

0 commit comments

Comments
 (0)