Skip to content

Conversation

@KianNH
Copy link
Member

@KianNH KianNH commented Jan 22, 2025

Summary

Before:

You can use zaraz.track() anywhere inside the <body> tag of a page.

Write Workers in 100% Rust using the [`workers-rs`crate](https://github.com/cloudflare/workers-rs)

After:

You can use zaraz.track() anywhere inside the <body> tag of a page.

Write Workers in 100% Rust using the workers-rs crate

}
Astro.props.entry.data.description ??= await getPageDescription(
Astro.props.entry.data.description = await getPageDescription(
Copy link
Member Author

Choose a reason for hiding this comment

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

We used to do if (entry.data.description) return entry.data.description; in getPageDescription but that didn't do anything - because we never used this function if that property existed.

That was a bug, but also fine since we never would have changed it. Now we are transforming it so removed ??.

Comment on lines +4 to +5
import { remark } from "remark";
import strip from "strip-markdown";
Copy link
Member Author

Choose a reason for hiding this comment

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

This could technically be done in a lot more lines with marked but most of their discussions recommend using other libraries, like strip-markdown.

const paragraph = dom.querySelector(":root > p");

if (description) return description.innerText;
if (paragraph) description = he.decode(paragraph.innerText);
Copy link
Member Author

Choose a reason for hiding this comment

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

&#x3C;body> -> <body>

let description = undefined;

if (entry.data.description) {
const file = await remark().use(strip).process(entry.data.description);
Copy link
Member Author

@KianNH KianNH Jan 22, 2025

Choose a reason for hiding this comment

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

[`workers-rs` crate](https://github.com/cloudflare/workers-rs)` -> `workers-rs crate`

@cloudflare-workers-and-pages
Copy link

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 03be761
Status: ✅  Deploy successful!
Preview URL: https://f2c45653.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://kian-pcx-14260.cloudflare-docs-7ou.pages.dev

View logs

@github-actions
Copy link
Contributor

Copy link
Collaborator

@kodster28 kodster28 left a comment

Choose a reason for hiding this comment

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

Output lgtm + this should only affect descriptions so it's a low-risk change.

@KianNH KianNH merged commit 11f2063 into production Jan 22, 2025
13 checks passed
@KianNH KianNH deleted the kian/PCX-14260 branch January 22, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.