-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Product Directory Refresh #18133
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
Product Directory Refresh #18133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of room for us to de-dupe this and ModelCatalog in the future. Left it be for now until we tackle a third instance of this pattern.
| import { getCollection, type CollectionEntry } from "astro:content"; | ||
| import { ThreeCardGrid, LinkCard } from "~/components"; | ||
| // @ts-ignore virtual module | ||
| import iconCollection from "virtual:astro-icon"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got 90% of the way through this work and then realised we have no good way to render icon / SVGs in react, and astro-icon does some interesting integration/optmimization under the hood. This code here replicates a little of what the Icon component does (https://github.com/natemoo-re/astro-icon/blob/531db17ec5367e22df7958d8f7abdeb880d8342b/packages/core/components/Icon.astro#L92) but just passes optimised SVG path data (as a string) through to React to render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had this in the jsx component, but due to how Astro works it was trying to import node modules into the client-side and breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried directly importing the icons (using import URLs), but you can't style SVG when used as an img src.
Deploying cloudflare-docs with
|
| Latest commit: |
0dfacf2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b2649889.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://hturan-products-directory.cloudflare-docs-7ou.pages.dev |
KianNH
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, the styling is perfect! This looks great.
I found a few small issues which are hopefully quick fixes.
KianNH
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
* Update Products directory * Fix changes to 1.1.1.1 icon * Fixed client-side node imports * Added dark colors * Design tweaks for truncated product names * Fix types, add category deep-links
Summary
This PR gives a visual and functional refresh to the Products page (https://developers.cloudflare.com/products), including iconography, product descriptions, and the ability to search.
Screenshots (optional)
Documentation checklist