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

feat: add links validator and update links #457

Merged
merged 1 commit into from
May 29, 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
7 changes: 7 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'astro/config'
import starlight from '@astrojs/starlight'
import astroI18next from 'astro-i18next'
import react from '@astrojs/react'
import starlightLinksValidator from 'starlight-links-validator'

// https://astro.build/config
export default defineConfig({
Expand All @@ -15,6 +16,12 @@ export default defineConfig({
'./node_modules/@interledger/docs-design-system/src/styles/teal-theme.css',
'./node_modules/@interledger/docs-design-system/src/styles/ilf-docs.css',
],
plugins: [
starlightLinksValidator({
errorOnFallbackPages: false,
exclude: ['/prob-revshare'],
}),
],
expressiveCode: {
styleOverrides: {
borderColor: 'transparent',
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^3.3.2",
"@astrojs/starlight": "^0.22.2",
"@astrojs/react": "^3.4.0",
"@astrojs/starlight": "^0.23.2",
"@interledger/docs-design-system": "^0.5.0",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "4.7.1",
"astro": "4.9.2",
"astro-i18next": "^1.0.0-beta.21",
"prettier": "^3.2.5",
"prism-react-renderer": "^2.3.1",
Expand All @@ -22,6 +22,7 @@
"react-minimal-pie-chart": "^8.4.0",
"remark-mermaidjs": "^6.0.0",
"respec": "^35.0.2",
"sharp": "^0.33.3"
"sharp": "^0.33.4",
"starlight-links-validator": "^0.9.0"
}
}
2 changes: 1 addition & 1 deletion src/content/docs/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ Web Monetization communicates with the sending and receiving accounts to obtain
A new version of the Web Monetization specification was published in June 2023. Users of the previous version should be aware of the following:

- The previous version only used Interledger's Simple Payment Setup Protocol (SPSP). The new version uses <LinkOut href="https://openpayments.guide/">Open Payments</LinkOut>.
- The `<meta>` element is deprecated in favor of the [`<link>`](./references/html-link-rel-monetization/) element.
- The `<meta>` element is deprecated in favor of the [`<link>`](/docs/references/html-link-rel-monetization/) element.
- The `<link>` element does not support the shorthand form of a payment pointer (e.g., `$wallet.example/alice`). You must use the endpoint URL that the payment pointer resolves to (e.g., `https://wallet.example/alice`). If you need help converting a payment pointer from shorthand to its equivalent URL, enter your payment pointer into the input field on <LinkOut href="https://paymentpointers.org">paymentpointers.org</LinkOut>. In most cases, you can simply replace the `$` with `https://`.
2 changes: 1 addition & 1 deletion src/content/docs/docs/references/attributes/amount.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BrowserCompat from '/src/components/docs/BrowserCompat.astro'
import data from '/src/data/browser-compat-data/amount.json'

:::danger[Caution - Deprecated Attribute]
The `amount` attribute is deprecated. Consider using the [amountSent](../amountsent/) attribute instead.
The `amount` attribute is deprecated. Consider using the [amountSent](/docs/references/attributes/amountsent) attribute instead.
:::

The `MonetizationEvent` `amount` attribute returned the amount of money that was successfully received on the last payment.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/references/attributes/assetcode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BrowserCompat from '/src/components/docs/BrowserCompat.astro'
import data from '/src/data/browser-compat-data/assetCode.json'

:::danger[Caution - Deprecated Attribute]
The `assetCode` attribute is deprecated. Consider using the [amountSent](../amountsent/) attribute instead.
The `assetCode` attribute is deprecated. Consider using the [amountSent](/docs/references/attributes/amountsent) attribute instead.
:::

The `MonetizationEvent` `assetCode` attribute returned the currency code of the last payment received.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/references/attributes/assetscale.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BrowserCompat from '/src/components/docs/BrowserCompat.astro'
import data from '/src/data/browser-compat-data/assetScale.json'

:::danger[Caution - Deprecated Attribute]
The `assetScale` attribute is deprecated. Consider using the [amountSent](../amountsent/) attribute instead.
The `assetScale` attribute is deprecated. Consider using the [amountSent](/docs/references/attributes/amountsent) attribute instead.
:::

The `MonetizationEvent` `assetScale` attribute returned the scale of the paid amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import data from '/src/data/browser-compat-data/incomingPayment.json'
import { LinkOut, Hidden } from '@interledger/docs-design-system'

:::tip[Experimental Attribute]
`incomingPayment` is an <LinkOut href="https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental">experimental technology</LinkOut>.<Hidden>Check the [Browser compatibility table](#browser-compatibility) before using.</Hidden>
`incomingPayment` is an <LinkOut href="https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental">experimental technology</LinkOut>.
:::

The `monetization` event's `incomingPayment` attribute can be used to verify the receipt of a payment. Today, the `monetization` event fires when the WM agent successfully creates an outgoing payment request at the WM provider. Since it's only a request to send an outgoing payment, there's no guarantee at this point that a payment has been received.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/references/attributes/receipt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BrowserCompat from '/src/components/docs/BrowserCompat.astro'
import data from '/src/data/browser-compat-data/receipt.json'

:::danger[Caution - Deprecated Attribute]
Receipts and its associated `receipt` attribute are deprecated. Consider using the [incomingPayment](../incomingpayment/) attribute instead.
Receipts and its associated `receipt` attribute are deprecated. Consider using the [incomingPayment](/docs/references/attributes/incomingpayment) attribute instead.
:::

The `MonetizationEvent` `receipt` attribute returned an optional proof-of-payment receipt. It was issued from the monetization receiver to the monetization provider as proof of the total current amount received in a stream.
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/es/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ Es un estándar propuesto que permite a los visitantes pagar una cantidad de su
- Obtención de autorización para iniciar el pago.
- Recopilar detalles y emitir instrucciones para iniciar el proceso de movimiento de dinero.
- Crear una sesión de pago.
- Comunicar eventos de pago al sitio para que el sitio pueda responder opcionalmente. Por ejemplo, el sitio podría [eliminar anuncios](/docs/guides/remove-ads) o proporcionar [acceso a contenido exclusivo](/docs/guides/provide-exclusive-content) para los visitantes que pagan.
- Comunicar eventos de pago al sitio para que el sitio pueda responder opcionalmente. Por ejemplo, el sitio podría [eliminar anuncios](/es/docs/guides/remove-ads) o proporcionar [acceso a contenido exclusivo](/es/docs/guides/provide-exclusive-content) para los visitantes que pagan.

### Flujo de alto nivel

La siguiente imagen muestra el flujo de monetización web en un nivel alto. Algunos pasos se han combinado o excluido. Se proporciona una explicación más detallada en la página [Flujo de monetización web](/docs/intro/web-monetization-flow).
La siguiente imagen muestra el flujo de monetización web en un nivel alto. Algunos pasos se han combinado o excluido. Se proporciona una explicación más detallada en la página [Flujo de monetización web](/es/docs/intro/web-monetization-flow).

<LargeImg
src='/img/docs/diagram-wm-overview.png'
alt='Descripción general de alto nivel del flujo de monetización web'
/>

1. Bob visita una [página web monetizada](/docs/guides/monetize-page). El elemento de monetización `<link>` es la forma en que el sitio web indica su aceptación de pagos al navegador.
1. Bob visita una [página web monetizada](/es/docs/guides/monetize-page). El elemento de monetización `<link>` es la forma en que el sitio web indica su aceptación de pagos al navegador.
2. El navegador de Bob, ya sea de forma nativa o mediante una extensión del navegador, analiza el elemento `<link>` para obtener <Tooltip content='Una URL que identifica una cuenta de Open Payments' client:load><a href="./resources/glossary#wallet-address">dirección de billetera</a></Tooltip> de Alice, la propietaria del sitio.
3. El navegador/extensión de Bob envía solicitudes a la dirección de la billetera de Alice para obtener autorización e instrucciones para enviar un pago.
4. Con la autorización concedida y las instrucciones de pago recibidas, el navegador/extensión envía solicitudes a la dirección de la billetera de Bob para iniciar el pago.
Expand All @@ -64,5 +64,5 @@ La monetización web se comunica con las cuentas emisoras y receptoras para obte
En junio de 2023 se publicó una nueva versión de la especificación de Monetización web. Los usuarios de la versión anterior deben tener en cuenta lo siguiente:

- La versión anterior solo utilizaba el Protocolo de configuración de pago simple (SPSP) de Interledger. La nueva versión utiliza <LinkOut href="https://openpayments.guide/">Open Payments</LinkOut>.
- El elemento `<meta>` está obsoleto en favor del elemento [`<link>`](./references/html-link-rel-monetization/).
- El elemento `<meta>` está obsoleto en favor del elemento [`<link>`](/es/docs/references/html-link-rel-monetization/).
- El elemento `<link>` no admite la forma abreviada de un puntero de pago (por ejemplo, `$wallet.example/alice`). Debes utilizar la URL completa a la que se resuelve el puntero de pago (por ejemplo, `https://wallet.example/alice`). Si necesitas ayuda para convertir un indicador de pago de una abreviatura a su URL equivalente, ingresa su indicador de pago en el campo de entrada en <LinkOut href="https://paymentpointers.org">paymentpointers.org</LinkOut>. En la mayoría de los casos, puedes simplemente reemplazar `$` por `https://`.
Loading