@seidhr/sanity-plugin-muna-schemas
Version:
Muna or ᛗᚢᚾᚨ means remember in norse. Muna is a schema for the Sanity Studio that enables detailed descriptions of cultural heritage objects and knowledge about their contexts as well as pages about them (or anything else really.)
151 lines (148 loc) • 3.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
name: 'Post',
type: 'document',
title: 'Blogg innlegg',
titleEN: 'Blog Post',
fields: [{
name: 'label',
title: 'Tittel',
titleEN: 'Title',
description: 'Titles should be catchy, descriptive, and not too long',
type: 'string'
}, {
name: 'slug',
type: 'slug',
title: 'Slug',
titleEN: 'Slug',
description: 'En "slug" bruks i sidens nettadresse. Basert på tittel',
descriptionEN: 'Some frontends will require a slug to be set to be able to show the post',
options: {
source: 'label',
maxLength: 96
}
}, {
name: 'publishedAt',
title: 'Publikasjonsdato',
titleEN: 'Published at',
description: 'Denne datoen kan settes frem i tid for fremtidig publisering på en nettside',
descriptionEN: 'This can be used to schedule post for publishing',
type: 'datetime',
options: {
semanticSanity: {
"@type": "xsd:dateTime"
}
}
}, {
name: 'excerpt',
type: 'simpleBlockContent',
title: 'Sammendrag',
titleEN: 'Excerpt',
description: 'Brukes på oversiktssider, på Google og på sosiale medier.',
descriptionEN: 'This ends up on summary pages, on Google, when people share your post in social media.',
options: {
semanticSanity: {
'@type': '@json'
}
}
}, {
name: 'image',
title: 'Hovedbilde',
titleEN: 'Main image',
type: 'DigitalObjectImage',
options: {
semanticSanity: {
'@type': '@json'
}
}
}, {
name: 'body',
title: 'Tekst',
titleEN: 'Body',
type: 'blockContent',
options: {
semanticSanity: {
'@type': '@json'
}
}
}, {
name: 'authors',
title: 'Authors',
type: 'array',
of: [{
type: 'ContributionAssignment'
}],
options: {
semanticSanity: {
'@container': '@list',
'@type': '@id'
}
}
}, {
name: 'categories',
title: 'Kategorier',
titleEN: 'Categories',
type: 'array',
of: [{
type: 'reference',
to: {
type: 'Concept'
}
}],
options: {
semanticSanity: {
'@container': '@set',
'@type': '@id'
}
}
}],
orderings: [{
name: 'publishingDateAsc',
title: 'Publishing date new–>old',
by: [{
field: 'publishedAt',
direction: 'asc'
}, {
field: 'label',
direction: 'asc'
}]
}, {
name: 'publishingDateDesc',
title: 'Publishing date old->new',
by: [{
field: 'publishedAt',
direction: 'desc'
}, {
field: 'label',
direction: 'asc'
}]
}],
preview: {
select: {
title: 'label',
publishedAt: 'publishedAt',
slug: 'slug',
media: 'image'
},
prepare(_ref) {
var _ref$title = _ref.title,
title = _ref$title === void 0 ? 'No title' : _ref$title,
publishedAt = _ref.publishedAt,
_ref$slug = _ref.slug,
slug = _ref$slug === void 0 ? {} : _ref$slug,
media = _ref.media;
var path = "/blog/".concat(slug.current);
return {
title,
media,
subtitle: publishedAt ? path : 'Uten publiseringsdato'
};
}
}
};
exports.default = _default;
//# sourceMappingURL=Post.js.map