-
Notifications
You must be signed in to change notification settings - Fork 151
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
Theme details JSON support #405
Conversation
✅ Deploy Preview for astro-www-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
async function resolveImage(src: string) { | ||
if (!(src in allImages)) { | ||
throw new Error(`[loadThemes] "${src}" image not found! Does it exist in /src/data/themes/images?`) | ||
} | ||
|
||
const mod = await allImages[src]() | ||
|
||
return mod.default | ||
} |
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.
The PR will use image URLs that are uploaded to Netlify from the form. Will that cause an error here?
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.
Can the form submission webhook commit images as part of the PR? I'm not sure if there's any guarantee how long the images are available on Netlify's CDN, especially if we delete the form submission once we merge in each PR
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.
Ah yeah that's doable, I can fetch the images and save them in the branch
categories: string[] | ||
featured?: number | ||
slug: string | ||
stars: number | ||
tags?: string[] |
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.
tags?: string[] | |
tags?: string[] | |
PREVIEW?: true |
It might also be a good idea to use a zod schema to parse the theme JSON so it's definitely the shape we expect
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.
agreed, that should be a pretty quick add here 👍
* Theme detail mockup (#393) * theme detail mockup * remove relative and overflow-hidden on body can't have overflow parents in order to use sticky * New theme submit page (#371) * new theme submit page * update editor tab size * add convenience children variant * remove tailwind forms for now, it does annoying things * update theme submit * remove tailwind forms, ended up not needing it * formatting lol * WIP: migrating from switch to radio group * address most PR feedback + polish radios * remove pnpm-lock oops lol * update tailwind * js-driven required asterisk * minor UX fixes for preview image input * set eslint parter to typescript * add preact * convert image input to preact component simplifies this quite a bit for not much JS weight * labels tho * convert button to preact component * write theme submit form in astro * update vscode settings.json, delete config.json * extract useHydrated hook * oops, need jsx apparently * ensure space after label text * update no-js experience for theme submit * Checkbox -> Radio + add focus style * fix accidental double children * image input area fix for firefox * update ux for paid/free fields * add fade-in to tailwind * remove useHydrated() + less layout shift * add form name * throwing a random form on the page to see if it works * that worked, time to add a file upload * last step, adding the custom thank you page * update form * remove dummy form for now * add tailwind container queries plugin * image input styling tweaks * add additional preview images * remove this weird thing * pull out form element * add wrapper element on theme submit form fixes a weird preact fragment hydration issue Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com> * fixes button component import * design tweaks to the best practices section, aligning nav header with our page title component * testing a few styling tweaks on theme details * Theme details JSON support (#405) * WIP: hooking up JSON data for a demo theme * WIP: hooking up buy vs. free links * hooking up theme card link for detail pages * using icons for theme tags/badges * removing rando file that firefox dropped in the repo * Update data sources * fixing merge conflict * TEMP: making theme cards an ugly yellow when it's temporary preview data * going nuts with zod validations * adding a Buy now to the theme cards Co-authored-by: tony-sull <tony-sull@users.noreply.github.com> * adds a carousel for mobile images on theme details * nit: typescript hints * avoid clobbering the base class's scrollIntoView Co-authored-by: Darius <19603573+itsMapleLeaf@users.noreply.github.com> Co-authored-by: tony-sull <tony-sull@users.noreply.github.com>
* Theme detail mockup (#393) * theme detail mockup * remove relative and overflow-hidden on body can't have overflow parents in order to use sticky * New theme submit page (#371) * new theme submit page * update editor tab size * add convenience children variant * remove tailwind forms for now, it does annoying things * update theme submit * remove tailwind forms, ended up not needing it * formatting lol * WIP: migrating from switch to radio group * address most PR feedback + polish radios * remove pnpm-lock oops lol * update tailwind * js-driven required asterisk * minor UX fixes for preview image input * set eslint parter to typescript * add preact * convert image input to preact component simplifies this quite a bit for not much JS weight * labels tho * convert button to preact component * write theme submit form in astro * update vscode settings.json, delete config.json * extract useHydrated hook * oops, need jsx apparently * ensure space after label text * update no-js experience for theme submit * Checkbox -> Radio + add focus style * fix accidental double children * image input area fix for firefox * update ux for paid/free fields * add fade-in to tailwind * remove useHydrated() + less layout shift * add form name * throwing a random form on the page to see if it works * that worked, time to add a file upload * last step, adding the custom thank you page * update form * remove dummy form for now * add tailwind container queries plugin * image input styling tweaks * add additional preview images * remove this weird thing * pull out form element * add wrapper element on theme submit form fixes a weird preact fragment hydration issue Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com> * fixes button component import * design tweaks to the best practices section, aligning nav header with our page title component * testing a few styling tweaks on theme details * Theme details JSON support (#405) * WIP: hooking up JSON data for a demo theme * WIP: hooking up buy vs. free links * hooking up theme card link for detail pages * using icons for theme tags/badges * removing rando file that firefox dropped in the repo * Update data sources * fixing merge conflict * TEMP: making theme cards an ugly yellow when it's temporary preview data * going nuts with zod validations * adding a Buy now to the theme cards Co-authored-by: tony-sull <tony-sull@users.noreply.github.com> * Adds a carousel for theme details on mobile (#410) * adds a carousel for mobile images on theme details * nit: typescript hints * avoid clobbering the base class's scrollIntoView * TEMP: sorting paid themes above free themes * removing the references to the production Odyssey theme * nit: tweaking layout of no-JS image input picker * [refactor] moving more of the form in Astro (#420) * WIP: testing how much of the form can be in astro vs. preact * cleaning up unused components * spacing tweaks * Updating themes data (#424) * adds the new Pro File paid theme * adds draft of Astroship details page * tweaking the theme details page styles * Updating Accessible Astro Starter (#425) * updating Accessible Astro Starter theme data * nit: more styling tweaks on the theme details page * using theme info for SEO tags * nit: working on accessible astro copy * A few more theme data updates and UI tweaks (#426) * updating Accessible Astro Starter theme data * nit: more styling tweaks on the theme details page * using theme info for SEO tags * nit: working on accessible astro copy * removes test theme data * moves the "Submit a theme" banner back to the top * send every theme to the details page, adds a free vs paid badge * fix: check for a demo URL before including the details page link * cleaning up unused theme card code * WIP: Adds a rich text editor to the theme submit form (#421) * WIP: adding trix-editor for the full theme details input * fix: trix-editor doesn't work well when wrapped in a label * updating existing theme details for Trix * style 💄 linter fixes in RichTextEditor * moving to the quill.js editor * adding a noscript warning for the richtexteditor * changing the list of rich text controls in the editor * updating theme data with latest launch submissions * Add theme submission fields for tools and keywords (#434) * remove duplicate components duplication is just asking for mistakes and confusion later lol * add white background to inputs * add tools/keywords inputs to theme submit * separate tag input and tag select * support as prop in Field * fix field import * add quill types * add tag on blur * adds AstroPaper details content (#443) * adds theme details for Odyssey and Pro File * adds extra details for Creek theme * update "Premium" themes to "Paid" themes * fixing mobile layout on details page * updating Submit your theme link * fixing typo in AstroPaper * Updates the list of theme collections (#449) * removes official collection * updates list of theme collections * reorders featured themes * Submit theme to discord (#436) * testing deployment * fix button import * the whole thing * mkdir before cloning * ensure current dir for other git commands * actually just always pass cwd lol * try iso git * use background function * log everything * create branch before checkout * console.info shows nothing? * add commit author * add git auth * only git add the updated theme * enable strict nulls for zod to work correctly * use local ts * save correct theme json * pivot: submit theme to discord * fix body parsing and some cleanup * add a nice error page * remove unuesd deps * remove PREVIEW * adding new featured theme hero images * fixing homepage overflow * adding support for theme author links (#450) * adding external links to theme detail CTAs * only including Astroship in landing pages * updates AstroInk hero image * Adds tags to all existing themes (#457) * adding tags for all existing themes * adding color to theme tags * a few more color tweaks on tag icons * adding a link to our Figma templates (#458) * remove lazy loading in the image carousel after idle * fixing style on homepage tab layout * submit theme to a thread (#461) Co-authored-by: Darius <19603573+itsMapleLeaf@users.noreply.github.com> Co-authored-by: tony-sull <tony-sull@users.noreply.github.com>
Adds support for full theme details content in our JSON pipeline