Cleanup assets
This commit is contained in:
+67
-18
@@ -2,11 +2,13 @@
|
||||
* Asset path utilities for handling different environments
|
||||
* - Web app: uses absolute paths starting with /
|
||||
* - Storybook: uses relative paths for proper asset resolution
|
||||
*
|
||||
* Folder map: `docs/guides/static-assets.md`
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the correct asset path based on environment
|
||||
* @param assetPath - The asset path (e.g., "assets/Logo.svg")
|
||||
* @param assetPath - The asset path (e.g., "assets/logos/community-rule.svg")
|
||||
* @returns The correct path for the current environment
|
||||
*/
|
||||
export function getAssetPath(assetPath: string): string {
|
||||
@@ -68,6 +70,43 @@ export function guideBannerLogoArrowPath(): string {
|
||||
return "assets/shapes/guide-banner-logo-arrow.svg";
|
||||
}
|
||||
|
||||
/** Partner logo wall SVGs in `public/assets/logos/partners/`. */
|
||||
export function partnerLogoPath(slug: string): string {
|
||||
return `assets/logos/partners/${slug}.svg`;
|
||||
}
|
||||
|
||||
/** Share modal glyphs in `public/assets/share/`. */
|
||||
export type ShareIconName = "discord" | "link" | "mail" | "signal" | "slack";
|
||||
|
||||
export function shareIconPath(name: ShareIconName): string {
|
||||
return `assets/share/${name}.svg`;
|
||||
}
|
||||
|
||||
/** Section number badges in `public/assets/marketing/`. */
|
||||
export function sectionNumberPath(n: 1 | 2 | 3): string {
|
||||
return `assets/marketing/section-number-${n}.svg`;
|
||||
}
|
||||
|
||||
/** Home feature grid panel art in `public/assets/marketing/`. */
|
||||
export type FeaturePanelKey = "support" | "exercises" | "guidance" | "tools";
|
||||
|
||||
export function featurePanelPath(key: FeaturePanelKey): string {
|
||||
return `assets/marketing/feature-${key}.png`;
|
||||
}
|
||||
|
||||
/** Case study card artwork in `public/assets/case-study/`. */
|
||||
export type CaseStudyVisualKey = "lavender" | "neutral" | "rose";
|
||||
|
||||
const CASE_STUDY_VISUAL_PATHS: Record<CaseStudyVisualKey, string> = {
|
||||
lavender: "assets/case-study/case-study-mutual-aid.svg",
|
||||
neutral: "assets/case-study/case-study-food-not-bombs.svg",
|
||||
rose: "assets/case-study/case-study-boulder-county-street-medics.svg",
|
||||
};
|
||||
|
||||
export function caseStudyVisualPath(key: CaseStudyVisualKey): string {
|
||||
return CASE_STUDY_VISUAL_PATHS[key];
|
||||
}
|
||||
|
||||
/** Per-article thumbnail backgrounds in `public/content/blog/` (Figma Thumbnail 19428:22574). */
|
||||
export function contentBlogVerticalPath(slug: string): string {
|
||||
return `/content/blog/${slug}-vertical.svg`;
|
||||
@@ -120,32 +159,42 @@ export function contentCatalogSlugForFallback(
|
||||
* Asset paths for common components
|
||||
*/
|
||||
export const ASSETS = {
|
||||
// Logo
|
||||
LOGO: "assets/logo/Logo.svg",
|
||||
// Brand logo
|
||||
LOGO: "assets/logos/community-rule.svg",
|
||||
|
||||
// Avatars
|
||||
AVATAR_1: "assets/Avatar_1.png",
|
||||
AVATAR_2: "assets/Avatar_2.png",
|
||||
AVATAR_3: "assets/Avatar_3.png",
|
||||
AVATAR_1: "assets/marketing/avatar-1.svg",
|
||||
AVATAR_2: "assets/marketing/avatar-2.svg",
|
||||
AVATAR_3: "assets/marketing/avatar-3.svg",
|
||||
|
||||
// Social media
|
||||
BLUESKY_LOGO: "assets/Bluesky_Logo.svg",
|
||||
GITLAB_ICON: "assets/GitLab_Icon.png",
|
||||
BLUESKY_LOGO: "assets/logos/bluesky.svg",
|
||||
GITLAB_ICON: "assets/logos/gitlab.svg",
|
||||
|
||||
// Content page decorative shapes
|
||||
CONTENT_SHAPE_1: "assets/Content_Shape_1.svg",
|
||||
CONTENT_SHAPE_2: "assets/Content_Shape_2.svg",
|
||||
CONTENT_SHAPE_1: "assets/shapes/content-shape-1.svg",
|
||||
CONTENT_SHAPE_2: "assets/shapes/content-shape-2.svg",
|
||||
|
||||
/** Default ContentBanner background when no article-specific art. */
|
||||
CONTENT_BANNER: "assets/marketing/content-banner.svg",
|
||||
|
||||
/** Quote block default avatar. */
|
||||
QUOTE_AVATAR: "assets/marketing/quote-avatar.svg",
|
||||
|
||||
/** Sections / Book cover (Figma **22137:891197**). */
|
||||
COMMUNITYRULES_COVER: "assets/communityrules-cover.svg",
|
||||
COMMUNITYRULES_COVER: "assets/marketing/communityrules-cover.svg",
|
||||
|
||||
// Alert icons
|
||||
ICON_ALERT: "assets/Icon_Alert.svg",
|
||||
ICON_CLOSE: "assets/Icon_Close.svg",
|
||||
// Marketing
|
||||
HERO_IMAGE: "assets/marketing/hero-image.png",
|
||||
|
||||
// Tooltip icons
|
||||
ICON_POINTER: "assets/Icon_Pointer.svg",
|
||||
// Top nav union ornaments
|
||||
UNION_XSM: "assets/shapes/union-xsm.svg",
|
||||
UNION_SM_MD_LG: "assets/shapes/union-sm-md-lg.svg",
|
||||
UNION_XLG: "assets/shapes/union-xlg.svg",
|
||||
|
||||
// Help icon
|
||||
ICON_HELP: "assets/Icon_Help.svg",
|
||||
// Alert / UI icons
|
||||
ICON_ALERT: "assets/icons/icon-alert.svg",
|
||||
ICON_CLOSE: "assets/icons/icon-close.svg",
|
||||
ICON_POINTER: "assets/icons/icon-pointer.svg",
|
||||
ICON_HELP: "assets/icons/icon-help.svg",
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user