Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up redirects a little bit #753

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ http {
rewrite ^/(.*)//+(.*) $scheme://$http_host/$1/$2 permanent; # remove adjacent slashes in the middle of the URI
rewrite ^/([^.]*[^/])$ $scheme://$http_host/$1/ permanent; # force a trailing slash except for files with an extension

# Permanent redirects (301)
rewrite ^/docs/hostedservice/(.*)$ $scheme://$http_host/docs/en/hosted-service/$1 permanent;
Copy link
Contributor Author

@benface benface Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those /docs/hostedservice/* URLs must be really old; I couldn't find any reference to them anywhere. Also, we deprecated the HS, so I think it's safe to remove this rule.

rewrite ^/docs/(?!(?:[a-zA-Z][a-zA-Z]|_next|img)(?:/|$))(.*)$ $scheme://$http_host/docs/en/$1 permanent; # Redirect to `/en` if no language in URL and not an asset URL
# Redirect to `/en` if no language in URL and not an asset URL
rewrite ^/docs/(?!(?:[a-zA-Z][a-zA-Z]|_next|img)(?:/|$))(.*)$ $scheme://$http_host/docs/en/$1 permanent;

# Permanent redirects (301)
rewrite ^/docs/([a-zA-Z][a-zA-Z])/about/introduction/$ $scheme://$http_host/docs/$1/about/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/about/network/$ $scheme://$http_host/docs/$1/network/overview/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/curating/$ $scheme://$http_host/docs/$1/network/curating/ permanent;
Expand Down Expand Up @@ -88,14 +88,16 @@ http {
rewrite ^/docs/([a-zA-Z][a-zA-Z])/arbitrum-faq/$ $scheme://$http_host/docs/$1/arbitrum/arbitrum-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/migrating-a-subgraph/$ $scheme://$http_host/docs/$1/cookbook/upgrading-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/quick-start/$ $scheme://$http_host/docs/$1/quick-start/ permanent;
rewrite ^/docs/en/substreams/(?!index\.).+$ https://substreams.streamingfast.io permanent;
rewrite ^/docs/en/firehose/(?!index\.).+$ https://firehose.streamingfast.io permanent;
Comment on lines -91 to -92
Copy link
Contributor Author

@benface benface Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved these to the bottom of the list because they're different from the others (English-only).

rewrite ^/docs/([a-zA-Z][a-zA-Z])/developer/assemblyscript-api/$ $scheme://$http_host/docs/$1/developing/graph-ts/api/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/assemblyscript-api/$ $scheme://$http_host/docs/$1/developing/graph-ts/api/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/managing/deprecating-a-subgraph/$ $scheme://$http_host/docs/$1/managing/transfer-and-deprecate-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/managing/transferring-subgraph-ownership/$ $scheme://$http_host/docs/$1/managing/transfer-and-deprecate-a-subgraph/ permanent;
Comment on lines +93 to +94
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the redirects that should have been included in #741; my bad for not noticing in my review. :)

rewrite ^/docs/en/substreams/(?!index\.).+$ https://substreams.streamingfast.io permanent;
rewrite ^/docs/en/firehose/(?!index\.).+$ https://firehose.streamingfast.io permanent;

# Temporary redirects (302)
rewrite ^/docs/en/querying/graph-client/$ $scheme://$http_host/docs/en/querying/graph-client/README/ redirect;
rewrite ^/docs/en/developing/graph-ts/$ $scheme://$http_host/docs/en/developing/graph-ts/README/ redirect;
rewrite ^/docs/en/querying/graph-client/$ $scheme://$http_host/docs/en/querying/graph-client/README/ redirect;
rewrite ^/docs/en/developing/graph-ts/$ $scheme://$http_host/docs/en/developing/graph-ts/README/ redirect;

location / {
try_files $uri $uri.html $uri/index.html =404;
Expand Down
26 changes: 1 addition & 25 deletions website/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,7 @@ export default withNextra({
destination: '/en/',
permanent: true,
},
{
source: '/en/arbitrum-faq/',
destination: '/en/arbitrum/arbitrum-faq/',
permanent: true,
},
{
source: '/en/querying/graph-client/',
destination: '/en/querying/graph-client/README/',
permanent: false,
},
{
source: '/en/developing/graph-ts/',
destination: '/en/developing/graph-ts/README/',
permanent: false,
},
{
source: '/en/developer/assemblyscript-api/',
destination: '/en/developing/graph-ts/api/',
permanent: true,
},
{
source: '/en/developing/assemblyscript-api/',
destination: '/en/developing/graph-ts/api/',
permanent: true,
},
Comment on lines -59 to -83
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason we ever needed to include redirects here (in addition to nginx.conf) is that there can still be links to the old URLs in the Markdown files. If that is the case, Next needs to be aware of them, otherwise the client-side router will link to a 404 (or maybe attempt to do a full page reload, which would be better, but still not ideal). But I hate having to maintain the same list of redirects in two places, so I went ahead and replaced all the old URLs still lingering around to the new ones, which allows us to remove these.

// If we ever change `output` to not be `export`, we should move all the redirects from `nginx.conf` here
],
images: {
unoptimized: true,
Expand Down
2 changes: 1 addition & 1 deletion website/pages/ar/cookbook/arweave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Schema definition describes the structure of the resulting subgraph database and

تمت كتابة المعالجات الخاصة بمعالجة الأحداث بـ[ أسيمبلي سكريبت ](https://www.assemblyscript.org/).

Arweave indexing introduces Arweave-specific data types to the [AssemblyScript API](/developing/assemblyscript-api/).
Arweave indexing introduces Arweave-specific data types to the [AssemblyScript API](/developing/graph-ts/api/).

```tsx
class Block {
Expand Down
2 changes: 1 addition & 1 deletion website/pages/ar/cookbook/cosmos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Schema definition describes the structure of the resulting subgraph database and

تمت كتابة المعالجات(handlers) الخاصة بمعالجة الأحداث بـ[ AssemblyScript ](https://www.assemblyscript.org/).

Cosmos indexing introduces Cosmos-specific data types to the [AssemblyScript API](/developing/assemblyscript-api/).
Cosmos indexing introduces Cosmos-specific data types to the [AssemblyScript API](/developing/graph-ts/api/).

```tsx
class Block {
Expand Down
8 changes: 4 additions & 4 deletions website/pages/ar/cookbook/near.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ title: بناء Subgraphs على NEAR

**schema.graphql:** a schema file that defines what data is stored for your subgraph, and how to query it via GraphQL. The requirements for NEAR subgraphs are covered by [the existing documentation](/developing/creating-a-subgraph#the-graphql-schema).

**AssemblyScript Mappings:** [AssemblyScript code](/developing/assemblyscript-api) that translates from the event data to the entities defined in your schema. NEAR support introduces NEAR-specific data types and new JSON parsing functionality.
**AssemblyScript Mappings:** [AssemblyScript code](/developing/graph-ts/api) that translates from the event data to the entities defined in your schema. NEAR support introduces NEAR-specific data types and new JSON parsing functionality.

During subgraph development there are two key commands:

Expand Down Expand Up @@ -98,7 +98,7 @@ Schema definition describes the structure of the resulting subgraph database and

تمت كتابة المعالجات(handlers) الخاصة بمعالجة الأحداث بـ[ AssemblyScript ](https://www.assemblyscript.org/).

NEAR indexing introduces NEAR-specific data types to the [AssemblyScript API](/developing/assemblyscript-api).
NEAR indexing introduces NEAR-specific data types to the [AssemblyScript API](/developing/graph-ts/api).

```typescript

Expand Down Expand Up @@ -165,9 +165,9 @@ These types are passed to block & receipt handlers:
- معالجات الكتلة ستتلقى`Block`
- معالجات الاستلام ستتلقى`ReceiptWithOutcome`

Otherwise, the rest of the [AssemblyScript API](/developing/assemblyscript-api) is available to NEAR subgraph developers during mapping execution.
Otherwise, the rest of the [AssemblyScript API](/developing/graph-ts/api) is available to NEAR subgraph developers during mapping execution.

This includes a new JSON parsing function - logs on NEAR are frequently emitted as stringified JSONs. A new `json.fromString(...)` function is available as part of the [JSON API](/developing/assemblyscript-api#json-api) to allow developers to easily process these logs.
This includes a new JSON parsing function - logs on NEAR are frequently emitted as stringified JSONs. A new `json.fromString(...)` function is available as part of the [JSON API](/developing/graph-ts/api#json-api) to allow developers to easily process these logs.

## نشر NEAR Subgraph

Expand Down
2 changes: 1 addition & 1 deletion website/pages/ar/cookbook/upgrading-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Make sure **Update Subgraph Details in Explorer** is checked and click on **Save

## Deprecating a Subgraph on The Graph Network

Follow the steps [here](/managing/deprecating-a-subgraph) to deprecate your subgraph and remove it from The Graph Network.
Follow the steps [here](/managing/transfer-and-deprecate-a-subgraph) to deprecate your subgraph and remove it from The Graph Network.

## Querying a Subgraph + Billing on The Graph Network

Expand Down
2 changes: 1 addition & 1 deletion website/pages/ar/developing/creating-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ The file data source must specifically mention all the entity types which it wil

#### Create a new handler to process files

This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/assemblyscript-api/#json-api)).
This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/graph-ts/api/#json-api)).

The CID of the file as a readable string can be accessed via the `dataSource` as follows:

Expand Down
2 changes: 1 addition & 1 deletion website/pages/ar/developing/unit-testing-framework.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ The log output includes the test run duration. Here's an example:

> Critical: Could not create WasmInstance from valid module with context: unknown import: wasi_snapshot_preview1::fd_write has not been defined

This means you have used `console.log` in your code, which is not supported by AssemblyScript. Please consider using the [Logging API](/developing/assemblyscript-api/#logging-api)
This means you have used `console.log` in your code, which is not supported by AssemblyScript. Please consider using the [Logging API](/developing/graph-ts/api/#logging-api)

> ERROR TS2554: Expected ? arguments, but got ?.
>
Expand Down
2 changes: 1 addition & 1 deletion website/pages/cs/cookbook/arweave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Definice schématu popisuje strukturu výsledné databáze podgrafu a vztahy mez

Obslužné programy pro zpracování událostí jsou napsány v jazyce [AssemblyScript](https://www.assemblyscript.org/).

Indexování Arweave zavádí do [AssemblyScript API](/developing/assemblyscript-api/) datové typy specifické pro Arweave.
Indexování Arweave zavádí do [AssemblyScript API](/developing/graph-ts/api/) datové typy specifické pro Arweave.

```tsx
class Block {
Expand Down
2 changes: 1 addition & 1 deletion website/pages/cs/cookbook/cosmos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Definice schématu popisuje strukturu výsledné databáze podgrafů a vztahy me

Obslužné programy pro zpracování událostí jsou napsány v jazyce [AssemblyScript](https://www.assemblyscript.org/).

Indexování Cosmos zavádí datové typy specifické pro Cosmos do [AssemblyScript API](/developing/assemblyscript-api/).
Indexování Cosmos zavádí datové typy specifické pro Cosmos do [AssemblyScript API](/developing/graph-ts/api/).

```tsx
class Block {
Expand Down
8 changes: 4 additions & 4 deletions website/pages/cs/cookbook/near.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Definice podgrafů má tři aspekty:

**schema.graphql:** soubor se schématem, který definuje, jaká data jsou uložena pro váš podgraf, a jak je možné je dotazovat pomocí GraphQL. Požadavky na podgrafy NEAR jsou pokryty [existující dokumentací](/developing/creating-a-subgraph#the-graphql-schema).

**Mapování v jazyce AssemblyScript:** [Kód jazyka AssemblyScript](/developing/assemblyscript-api), který převádí data událostí na entity definované ve vašem schématu. Podpora NEAR zavádí datové typy specifické pro NEAR a nové funkce pro parsování JSON.
**Mapování v jazyce AssemblyScript:** [Kód jazyka AssemblyScript](/developing/graph-ts/api), který převádí data událostí na entity definované ve vašem schématu. Podpora NEAR zavádí datové typy specifické pro NEAR a nové funkce pro parsování JSON.

Při vývoji podgrafů existují dva klíčové příkazy:

Expand Down Expand Up @@ -98,7 +98,7 @@ Definice schématu popisuje strukturu výsledné databáze podgrafů a vztahy me

Obslužné programy pro zpracování událostí jsou napsány v jazyce [AssemblyScript](https://www.assemblyscript.org/).

Indexování NEAR zavádí do rozhraní [AssemblyScript API](/developing/assemblyscript-api) datové typy specifické pro NEAR.
Indexování NEAR zavádí do rozhraní [AssemblyScript API](/developing/graph-ts/api) datové typy specifické pro NEAR.

```typescript

Expand Down Expand Up @@ -165,9 +165,9 @@ Tyto typy jsou předány do block & obsluha účtenek:
- Obsluhy bloků obdrží `Block`
- Obsluhy příjmu obdrží `ReceiptWithOutcome`

Jinak je zbytek [AssemblyScript API](/developing/assemblyscript-api) dostupný vývojářům podgrafů NEAR během provádění mapování.
Jinak je zbytek [AssemblyScript API](/developing/graph-ts/api) dostupný vývojářům podgrafů NEAR během provádění mapování.

To zahrnuje novou funkci parsování JSON - záznamy na NEAR jsou často vysílány ve formě zřetězených JSON. Nová funkce `json.fromString(...)` je k dispozici jako součást [JSON API](/developing/assemblyscript-api#json-api), které umožňuje vývojářům snadno zpracovávat tyto záznamy.
To zahrnuje novou funkci parsování JSON - záznamy na NEAR jsou často vysílány ve formě zřetězených JSON. Nová funkce `json.fromString(...)` je k dispozici jako součást [JSON API](/developing/graph-ts/api#json-api), které umožňuje vývojářům snadno zpracovávat tyto záznamy.

## Nasazení podgrafu NEAR

Expand Down
2 changes: 1 addition & 1 deletion website/pages/cs/cookbook/upgrading-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Ujistěte se, že je zaškrtnuto políčko **Aktualizovat podrobnosti subgrafu v

## Odepsání subgrafu v síti Graph

Postupujte podle pokynů [zde](/managing/deprecating-a-subgraph), abyste svůj podgraf vyřadili a odstranili jej ze sítě The Graph Network.
Postupujte podle pokynů [zde](/managing/transfer-and-deprecate-a-subgraph), abyste svůj podgraf vyřadili a odstranili jej ze sítě The Graph Network.

## Dotazování podgrafu + fakturace v síti graph

Expand Down
2 changes: 1 addition & 1 deletion website/pages/cs/developing/creating-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ The file data source must specifically mention all the entity types which it wil

#### Vytvoření nové obslužné pro zpracování souborů

This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/assemblyscript-api/#json-api)).
This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/graph-ts/api/#json-api)).

CID souboru jako čitelný řetězec lze získat prostřednictvím `dataSource` následujícím způsobem:

Expand Down
2 changes: 1 addition & 1 deletion website/pages/cs/developing/unit-testing-framework.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ Výstup protokolu obsahuje dobu trvání test. Zde je příklad:

> Kritické: Nelze vytvořit WasmInstance z platného modulu s kontextem: neznámý import: wasi_snapshot_preview1::fd_write nebyl definován

To znamená, že jste ve svém kódu použili `console.log`, což není podporováno jazykem AssemblyScript. Zvažte prosím použití [Logging API](/developing/assemblyscript-api/#logging-api)
To znamená, že jste ve svém kódu použili `console.log`, což není podporováno jazykem AssemblyScript. Zvažte prosím použití [Logging API](/developing/graph-ts/api/#logging-api)

> ERROR TS2554: Expected ? arguments, but got ?.
>
Expand Down
2 changes: 1 addition & 1 deletion website/pages/de/cookbook/arweave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Schema definition describes the structure of the resulting subgraph database and

Die Handler für die Ereignisverarbeitung sind in [AssemblyScript](https://www.assemblyscript.org/) geschrieben.

Arweave indexing introduces Arweave-specific data types to the [AssemblyScript API](/developing/assemblyscript-api/).
Arweave indexing introduces Arweave-specific data types to the [AssemblyScript API](/developing/graph-ts/api/).

```tsx
class Block {
Expand Down
2 changes: 1 addition & 1 deletion website/pages/de/cookbook/cosmos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Schema definition describes the structure of the resulting subgraph database and

Die Handler für die Ereignisverarbeitung sind in [AssemblyScript](https://www.assemblyscript.org/) geschrieben.

Die Cosmos-Indizierung führt Cosmos-spezifische Datentypen in die [AssemblyScript-API](/developing/assemblyscript-api/) ein.
Die Cosmos-Indizierung führt Cosmos-spezifische Datentypen in die [AssemblyScript-API](/developing/graph-ts/api/) ein.

```tsx
class Block {
Expand Down
8 changes: 4 additions & 4 deletions website/pages/de/cookbook/near.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ There are three aspects of subgraph definition:

**schema.graphql:** a schema file that defines what data is stored for your subgraph, and how to query it via GraphQL. The requirements for NEAR subgraphs are covered by [the existing documentation](/developing/creating-a-subgraph#the-graphql-schema).

**AssemblyScript Mappings:** [AssemblyScript code](/developing/assemblyscript-api) that translates from the event data to the entities defined in your schema. NEAR support introduces NEAR-specific data types and new JSON parsing functionality.
**AssemblyScript Mappings:** [AssemblyScript code](/developing/graph-ts/api) that translates from the event data to the entities defined in your schema. NEAR support introduces NEAR-specific data types and new JSON parsing functionality.

During subgraph development there are two key commands:

Expand Down Expand Up @@ -98,7 +98,7 @@ Schema definition describes the structure of the resulting subgraph database and

Die Handler für die Ereignisverarbeitung sind in [AssemblyScript](https://www.assemblyscript.org/) geschrieben.

NEAR indexing introduces NEAR-specific data types to the [AssemblyScript API](/developing/assemblyscript-api).
NEAR indexing introduces NEAR-specific data types to the [AssemblyScript API](/developing/graph-ts/api).

```typescript

Expand Down Expand Up @@ -165,9 +165,9 @@ These types are passed to block & receipt handlers:
- Block handlers will receive a `Block`
- Receipt handlers will receive a `ReceiptWithOutcome`

Otherwise, the rest of the [AssemblyScript API](/developing/assemblyscript-api) is available to NEAR subgraph developers during mapping execution.
Otherwise, the rest of the [AssemblyScript API](/developing/graph-ts/api) is available to NEAR subgraph developers during mapping execution.

This includes a new JSON parsing function - logs on NEAR are frequently emitted as stringified JSONs. A new `json.fromString(...)` function is available as part of the [JSON API](/developing/assemblyscript-api#json-api) to allow developers to easily process these logs.
This includes a new JSON parsing function - logs on NEAR are frequently emitted as stringified JSONs. A new `json.fromString(...)` function is available as part of the [JSON API](/developing/graph-ts/api#json-api) to allow developers to easily process these logs.

## Deploying a NEAR Subgraph

Expand Down
2 changes: 1 addition & 1 deletion website/pages/de/cookbook/upgrading-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Make sure **Update Subgraph Details in Explorer** is checked and click on **Save

## Deprecating a Subgraph on The Graph Network

Follow the steps [here](/managing/deprecating-a-subgraph) to deprecate your subgraph and remove it from The Graph Network.
Follow the steps [here](/managing/transfer-and-deprecate-a-subgraph) to deprecate your subgraph and remove it from The Graph Network.

## Querying a Subgraph + Billing on The Graph Network

Expand Down
2 changes: 1 addition & 1 deletion website/pages/de/developing/creating-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ The file data source must specifically mention all the entity types which it wil

#### Create a new handler to process files

This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/assemblyscript-api/#json-api)).
This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/graph-ts/api/#json-api)).

The CID of the file as a readable string can be accessed via the `dataSource` as follows:

Expand Down
Loading
Loading