Skip to content

Commit

Permalink
Merge pull request #347 from significa/SIGN-649
Browse files Browse the repository at this point in the history
Add Service, Deliverable, Tech stack, and Industry data to Blog and Projects
  • Loading branch information
kaaps authored Mar 6, 2024
2 parents 8c1e7fe + 84e38e9 commit 6bcdb4b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 53 deletions.
98 changes: 69 additions & 29 deletions components.198185.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"name": "blog-post",
"display_name": "Author",
"created_at": "2023-02-15T13:03:53.849Z",
"updated_at": "2024-02-08T14:39:36.267Z",
"updated_at": "2024-03-05T15:42:48.889Z",
"id": 3442347,
"schema": {
"cover": {
Expand Down Expand Up @@ -347,6 +347,27 @@
"required": true,
"min_options": "1",
"max_options": "4"
},
"services": {
"type": "options",
"source": "internal",
"datasource_slug": "services"
},
"deliverables": {
"type": "options",
"source": "internal",
"datasource_slug": "deliverables"
},
"tech": {
"type": "options",
"display_name": "",
"source": "internal",
"datasource_slug": "tech-stack"
},
"industry": {
"type": "options",
"source": "internal",
"datasource_slug": "industry"
}
},
"image": "//a.storyblok.com/f/198185/x/f51edbf69b/screenshot-2023-03-22-at-11-49-53.png",
Expand Down Expand Up @@ -2720,24 +2741,27 @@
"name": "project",
"display_name": null,
"created_at": "2023-02-15T13:07:44.621Z",
"updated_at": "2024-02-08T14:39:09.539Z",
"updated_at": "2024-03-06T10:30:35.274Z",
"id": 3442356,
"schema": {
"cover": {
"type": "asset",
"filetypes": ["images"],
"asset_folder_id": 212286,
"pos": 0
"pos": 0,
"key": "cover"
},
"reel": {
"type": "asset",
"pos": 1,
"filetypes": ["videos"]
"filetypes": ["videos"],
"key": "reel"
},
"reel_button": {
"type": "section",
"pos": 2,
"keys": ["reel_button_theme", "reel_button_label"]
"keys": ["reel_button_theme", "reel_button_label"],
"key": "reel_button"
},
"reel_button_theme": {
"type": "option",
Expand All @@ -2757,67 +2781,78 @@
],
"default_value": "light",
"description": "",
"display_name": "Reel Button Theme (optional)"
"display_name": "Reel Button Theme (optional)",
"key": "reel_button_theme"
},
"reel_button_label": {
"type": "text",
"pos": 4,
"display_name": "Reel Button Label (optional)"
"display_name": "Reel Button Label (optional)",
"key": "reel_button_label"
},
"thumbnail": {
"type": "multiasset",
"filetypes": ["images"],
"required": true,
"asset_folder_id": 212286,
"pos": 5
"pos": 5,
"key": "thumbnail"
},
"tagline": {
"type": "text",
"required": true,
"pos": 6
"pos": 6,
"key": "tagline"
},
"intro": {
"type": "textarea",
"required": true,
"pos": 7
"pos": 7,
"key": "intro"
},
"team": {
"type": "options",
"source": "internal_stories",
"filter_content_type": ["team-member"],
"pos": 8
"pos": 8,
"key": "team"
},
"client": {
"type": "text",
"use_uuid": true,
"source": "internal_stories",
"filter_content_type": ["client"],
"pos": 9
"pos": 9,
"key": "client"
},
"deliverables": {
"type": "textarea",
"source": "internal_stories",
"filter_content_type": ["deliverable"],
"pos": 10
"type": "options",
"pos": 10,
"source": "internal",
"datasource_slug": "deliverables",
"key": "deliverables"
},
"services": {
"type": "textarea",
"source": "internal_stories",
"filter_content_type": ["service"],
"pos": 11
"type": "options",
"pos": 11,
"source": "internal",
"datasource_slug": "services",
"key": "services_data"
},
"links": {
"type": "bloks",
"restrict_type": "",
"restrict_components": true,
"component_whitelist": ["link"],
"pos": 12
"pos": 12,
"key": "links"
},
"tab-734adeb1-00ef-48e6-aa53-a3001ad39201": {
"display_name": "Content",
"keys": ["body"],
"pos": 14,
"type": "tab"
"pos": 13,
"type": "tab",
"key": "tab-734adeb1-00ef-48e6-aa53-a3001ad39201"
},
"body": {
"type": "richtext",
Expand Down Expand Up @@ -2845,27 +2880,32 @@
"blok",
"h4"
],
"pos": 15
"pos": 14,
"key": "body"
},
"tab-451d56bd-d365-4df0-8a61-2007b8b22aa9": {
"display_name": "SEO",
"keys": ["seo_title", "seo_description", "seo_og_image"],
"pos": 16,
"type": "tab"
"pos": 15,
"type": "tab",
"key": "tab-451d56bd-d365-4df0-8a61-2007b8b22aa9"
},
"seo_title": {
"type": "text",
"pos": 17
"pos": 16,
"key": "seo_title"
},
"seo_description": {
"type": "text",
"pos": 18
"pos": 17,
"key": "seo_description"
},
"seo_og_image": {
"type": "asset",
"filetypes": ["images"],
"asset_folder_id": 212286,
"pos": 19
"pos": 18,
"key": "seo_og_image"
}
},
"image": null,
Expand Down
24 changes: 11 additions & 13 deletions src/components/pages/project.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export let related: ProjectPage[];
$: next = related[related.findIndex((p) => p.id === story.id) + 1] || related[0];
const recognitions = $page.data.awards.filter((aw) => aw.content.project.id === story.id);
$: recognitions = $page.data.awards.filter((aw) => aw.content.project.id === story.id);
</script>

<Seo
Expand Down Expand Up @@ -75,25 +75,23 @@
{#if data}
<ul class="col-span-1">
<h4 class="mb-2 text-xs uppercase tracking-wider text-foreground-secondary">{title}</h4>
{#if Array.isArray(data)}
<!-- Links -->
{#each data as link}
{@const { href, target, rel } = getAnchorFromCmsLink(link.link)}

<!-- Links -->
{#each data as line}
{#if typeof line === 'object'}
{@const { href, target, rel } = getAnchorFromCmsLink(line.link)}
{#if href}
<li class="mb-2 flex items-center gap-1">
<Link {href} {target} {rel}>{link.label}</Link>
<Link {href} {target} {rel}>{line.label}</Link>
<Icon class="mt-0.5" icon="arrow-external" />
</li>
{/if}
{/each}
{:else}
<!-- Textareas -->
{#each data.split('\n') as line}
{:else}
<li>
<p class="mb-2 text-base">{line}</p>
<p class="mb-2 text-base capitalize">{line}</p>
</li>
{/each}
{/if}
{/if}
{/each}
</ul>
{/if}
{/each}
Expand Down
9 changes: 5 additions & 4 deletions src/components/pages/projects-index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
let deliverables: string[] = [];
$: {
projects.forEach((project) => {
project.content.services?.split('\n').forEach((item) => {
if (!services.includes(item)) {
project.content.services?.forEach((item) => {
if (typeof item === 'string' && !services.includes(item)) {
services.push(item);
}
});
project.content.deliverables?.split('\n').forEach((item) => {
if (!deliverables.includes(item)) {
project.content.deliverables?.forEach((item) => {
if (typeof item === 'string' && !deliverables.includes(item)) {
deliverables.push(item);
}
});
Expand Down Expand Up @@ -85,6 +85,7 @@
<div class="mt-2 flex flex-wrap gap-2">
{#each items as item}
<Tag
class="capitalize"
label={item}
active={filters.some((f) => f.value === item)}
on:click={() => {
Expand Down
6 changes: 1 addition & 5 deletions src/lib/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ export type BlogPostPage = ISbStoryData<
project: ISbStoryData<ProjectStoryblok>;
}
>;
export type ProjectPage = ISbStoryData<
Omit<ProjectStoryblok, 'team'> & {
team: ISbStoryData<TeamMemberStoryblok>[];
}
>;
export type ProjectPage = ISbStoryData<ProjectStoryblok>;
export type TeamMemberPage = ISbStoryData<TeamMemberStoryblok>;
export type LandingPage = ISbStoryData<LandingPageStoryblok>;

Expand Down
8 changes: 6 additions & 2 deletions src/types/bloks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ export interface BlogPostStoryblok {
seo_og_image?: AssetStoryblok;
body?: RichtextStoryblok;
authors: (StoryblokStory<TeamMemberStoryblok> | string)[];
services?: (number | string)[];
deliverables?: (number | string)[];
tech?: (number | string)[];
industry?: (number | string)[];
_uid: string;
component: 'blog-post';
[k: string]: any;
Expand Down Expand Up @@ -722,8 +726,8 @@ export interface ProjectStoryblok {
intro: string;
team?: (StoryblokStory<TeamMemberStoryblok> | string)[];
client?: string;
deliverables?: string;
services?: string;
deliverables?: (number | string)[];
services?: (number | string)[];
links?: LinkStoryblok[];
body?: RichtextStoryblok;
seo_title?: string;
Expand Down

0 comments on commit 6bcdb4b

Please sign in to comment.