Skip to content

Commit

Permalink
Use descriptions and summaries from registry (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding authored Sep 8, 2023
1 parent 8a862c5 commit 95717d2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 8 additions & 1 deletion gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,18 @@ export const sourceNodes: GatsbyNode[`sourceNodes`] = async ({
: undefined;

const [snapLocation, slug] = snap.id.split(':');
const description = normalizeDescription(
snap.metadata.description ?? manifest.description,
);
const summary = normalizeDescription(
snap.metadata.summary ?? manifest.description,
);
const content = {
...snap.metadata,
snapId: snap.id,
name: manifest.proposedName,
description: normalizeDescription(manifest.description),
description,
summary,
location: snapLocation,
slug,
latestVersion,
Expand Down
9 changes: 3 additions & 6 deletions src/components/SnapCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import { SnapAuthorship } from './SnapAuthorship';
import type { Fields } from '../utils';

export const SnapCard: FunctionComponent<
Fields<
Queries.Snap,
'name' | 'description' | 'snapId' | 'icon' | 'gatsbyPath'
>
> = ({ name, description, snapId, icon, gatsbyPath }) => {
Fields<Queries.Snap, 'name' | 'summary' | 'snapId' | 'icon' | 'gatsbyPath'>
> = ({ name, summary, snapId, icon, gatsbyPath }) => {
return (
<Link to={gatsbyPath}>
<Flex
Expand All @@ -35,7 +32,7 @@ export const SnapCard: FunctionComponent<
WebkitBoxOrient: 'vertical',
}}
>
{description}
{summary}
</Text>
</Flex>
</Flex>
Expand Down
1 change: 1 addition & 0 deletions src/components/providers/SnapsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const SnapsProvider: FunctionComponent<SnapsProviderProps> = ({
nodes {
snapId
name
summary
description
icon
latestVersion
Expand Down

0 comments on commit 95717d2

Please sign in to comment.