Skip to content

Commit 9878153

Browse files
committed
[TOOL-3786] Portal: Improve llms.txt, llms-full.txt (#6532)
1 parent d3a5ea7 commit 9878153

File tree

5 files changed

+20
-15
lines changed
  • apps/portal/src/app
    • api/search/extraction
    • connect
    • react/v5/account-abstraction/batching-transactions
    • typescript/v5/account-abstraction/batching-transactions

5 files changed

+20
-15
lines changed

apps/portal/src/app/api/search/extraction/index.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ function extractPageLLMContent(
155155

156156
const htmlToMarkdown = new NodeHtmlMarkdown({
157157
keepDataImages: false,
158+
ignore: ["button"],
159+
maxConsecutiveNewlines: 2,
158160
});
159161

160162
let linksContent = "";
@@ -167,10 +169,7 @@ function extractPageLLMContent(
167169
let description = "";
168170
for (const p of paragraphs) {
169171
// skip noindex or no-llm paragraphs
170-
if (
171-
p.getAttribute("data-noindex") === "true" ||
172-
p.getAttribute("data-no-llm") === "true"
173-
) {
172+
if (p.closest("[data-noindex]") || p.closest("[data-no-llm]")) {
174173
continue;
175174
}
176175

@@ -180,7 +179,7 @@ function extractPageLLMContent(
180179
}
181180
}
182181

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

185184
// Remove noindex and no-llm elements
186185
const contentElements = main.querySelectorAll("*");
@@ -204,12 +203,18 @@ function extractPageLLMContent(
204203
// prefix all the relative links with the `https://portal.thirdweb.com`
205204
const links = main.querySelectorAll("a");
206205
for (const link of links) {
207-
const [path, hash] = link.getAttribute("href")?.split("#") || [];
208-
if (path?.startsWith("/")) {
209-
link.setAttribute(
210-
"href",
211-
`https://portal.thirdweb.com${path}${hash ? `#${hash}` : ""}`,
212-
);
206+
const href = link.getAttribute("href");
207+
if (href?.startsWith("/")) {
208+
link.setAttribute("href", `https://portal.thirdweb.com${href}`);
209+
}
210+
}
211+
212+
// prefix all relative image links with the `https://portal.thirdweb.com`
213+
const images = main.querySelectorAll("img");
214+
for (const image of images) {
215+
const src = image.getAttribute("src");
216+
if (src?.startsWith("/")) {
217+
image.setAttribute("src", `https://portal.thirdweb.com${src}`);
213218
}
214219
}
215220

apps/portal/src/app/connect/account-abstraction/batching-transactions/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const metadata = createMetadata({
1212
description: "How to batch transactions with smart accounts",
1313
});
1414

15-
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.
15+
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.
1616

1717
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.
1818

apps/portal/src/app/connect/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Get started with Connect in your preferred language.
8383
- **Connect to 500+ different wallet providers** with support for every EVM network
8484
- **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.
8585
- **Sponsor transactions** to seamlessly onboard non-native or new crypto users with [Account Abstraction](https://portal.thirdweb.com/connect/account-abstraction/overview).
86-
- **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)
86+
- **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)
8787
- **Easily integrate with thirdweb's contracts** to enable users to interact with your application.
8888
- **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).
8989

apps/portal/src/app/react/v5/account-abstraction/batching-transactions/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const metadata = createMetadata({
1212
description: "How to batch transactions with smart accounts",
1313
});
1414

15-
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.
15+
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.
1616

1717
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.
1818

apps/portal/src/app/typescript/v5/account-abstraction/batching-transactions/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const metadata = createMetadata({
1212
description: "How to batch transactions with smart accounts",
1313
});
1414

15-
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.
15+
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.
1616

1717
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.
1818

0 commit comments

Comments
 (0)