Skip to content
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
27 changes: 16 additions & 11 deletions apps/portal/src/app/api/search/extraction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ function extractPageLLMContent(

const htmlToMarkdown = new NodeHtmlMarkdown({
keepDataImages: false,
ignore: ["button"],
maxConsecutiveNewlines: 2,
});

let linksContent = "";
Expand All @@ -167,10 +169,7 @@ function extractPageLLMContent(
let description = "";
for (const p of paragraphs) {
// skip noindex or no-llm paragraphs
if (
p.getAttribute("data-noindex") === "true" ||
p.getAttribute("data-no-llm") === "true"
) {
if (p.closest("[data-noindex]") || p.closest("[data-no-llm]")) {
continue;
}

Expand All @@ -180,7 +179,7 @@ function extractPageLLMContent(
}
}

linksContent += `* [${pageTitle}](${pageUrl}): ${description}`;
linksContent += `* [${pageTitle}](${pageUrl}): ${description || `Reference for ${pageTitle}`}`;

// Remove noindex and no-llm elements
const contentElements = main.querySelectorAll("*");
Expand All @@ -204,12 +203,18 @@ function extractPageLLMContent(
// prefix all the relative links with the `https://portal.thirdweb.com`
const links = main.querySelectorAll("a");
for (const link of links) {
const [path, hash] = link.getAttribute("href")?.split("#") || [];
if (path?.startsWith("/")) {
link.setAttribute(
"href",
`https://portal.thirdweb.com${path}${hash ? `#${hash}` : ""}`,
);
const href = link.getAttribute("href");
if (href?.startsWith("/")) {
link.setAttribute("href", `https://portal.thirdweb.com${href}`);
}
}

// prefix all relative image links with the `https://portal.thirdweb.com`
const images = main.querySelectorAll("img");
for (const image of images) {
const src = image.getAttribute("src");
if (src?.startsWith("/")) {
image.setAttribute("src", `https://portal.thirdweb.com${src}`);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata = createMetadata({
description: "How to batch transactions with smart accounts",
});

Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confimations or to ensure that multiple transactions are executed atomically.
Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confirmations or to ensure that multiple transactions are executed atomically.

A typical example is to do an approval and a transfer in a single userOperation. This way, the transfer will only happen if the approval is successful.

Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/app/connect/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Get started with Connect in your preferred language.
- **Connect to 500+ different wallet providers** with support for every EVM network
- **Log in and authenticate your users** with customizable and secure [email, phone, passkeys and social login](https://portal.thirdweb.com/connect/in-app-wallet/overview) flows.
- **Sponsor transactions** to seamlessly onboard non-native or new crypto users with [Account Abstraction](https://portal.thirdweb.com/connect/account-abstraction/overview).
- **Perform wallet actions** like connecting and disconnecting wallets, viewing balance, displaying ENS names, and execute transactions with our [perfomant, reliable and type safe API](https://portal.thirdweb.com/connect/blockchain-api)
- **Perform wallet actions** like connecting and disconnecting wallets, viewing balance, displaying ENS names, and execute transactions with our [performant, reliable and type safe API](https://portal.thirdweb.com/connect/blockchain-api)
- **Easily integrate with thirdweb's contracts** to enable users to interact with your application.
- **Facilitate payments** by letting user top up their wallets or do onchain purchases with a credit card with [Pay](https://portal.thirdweb.com/connect/pay/overview).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata = createMetadata({
description: "How to batch transactions with smart accounts",
});

Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confimations or to ensure that multiple transactions are executed atomically.
Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confirmations or to ensure that multiple transactions are executed atomically.

A typical example is to do an approval and a transfer in a single userOperation. This way, the transfer will only happen if the approval is successful.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata = createMetadata({
description: "How to batch transactions with smart accounts",
});

Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confimations or to ensure that multiple transactions are executed atomically.
Batching transactions allows sending multiple transactions in a single user operation. This can be useful to save on fees, reduce number of user confirmations or to ensure that multiple transactions are executed atomically.

A typical example is to do an approval and a transfer in a single userOperation. This way, the transfer will only happen if the approval is successful.

Expand Down
Loading