Skip to content

Commit

Permalink
change link to linkType in portableText schema
Browse files Browse the repository at this point in the history
  • Loading branch information
milewskibogumil committed Oct 14, 2024
1 parent a00151c commit 287f805
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/astro/src/components/ui/portable-text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const PortableTextQuery = (name: string) => `
_type == "link" => {
_type,
_key,
type,
"href": select(type == "internal" => internal -> slug.current, type == "external" => external, "#"),
linkType,
"href": select(linkType == "internal" => internal -> slug.current, linkType == "external" => external, "#"),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const PortableText = ({ name, title, allowHeadings = false }: { name?: st
icon: () => '🔗',
fields: [
defineField({
name: 'type',
name: 'linkType',
type: 'string',
title: 'Type',
description: 'Choose "External" for links to websites outside your domain, or "Internal" for links to pages within your site.',
Expand Down
4 changes: 2 additions & 2 deletions apps/sanity/structure/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const components = [
// UI Components
import cta from '../schema/ui/cta';
import seo from '../schema/ui/seo';
import PortableText from '../schema/ui/PortableText';
import Heading from '../schema/ui/PortableText/Heading';
import PortableText from '../schema/ui/portable-text';
import Heading from '../schema/ui/portable-text/Heading';

const ui = [
cta,
Expand Down
2 changes: 1 addition & 1 deletion apps/sanity/utils/define-slug-for-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const defineSlugForDocument = ({ prefix = '', slug }: { prefix?: string,
defineField({
name: 'slug',
type: 'slug',
title: `Slug`,
title: 'Slug',
description: (
<>
Slug is a unique identifier for the document, used for SEO and links.
Expand Down

0 comments on commit 287f805

Please sign in to comment.