This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default createSchema({ | |
// We name our schema | |
name: 'default', | |
// Then proceed to concatenate our document type | |
// to the ones provided by any plugins that are installed | |
types: schemaTypes.concat([ | |
{ | |
name: 'frontpage', | |
type: 'document', | |
title: 'Frontpage', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from 'prop-types' | |
import React from 'react' | |
import Fieldset from 'part:@sanity/components/fieldsets/default' | |
import {setIfMissing} from 'part:@sanity/form-builder/patch-event' | |
// FormBuilderInput automatically generates fields from a schema | |
import {FormBuilderInput} from 'part:@sanity/form-builder' | |
// a Higher Order Component that passes document values as props | |
import {withDocument} from 'part:@sanity/form-builder' | |
class confitionalFields extends React.PureComponent { | |
static propTypes = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { isFuture, parseISO } = require('date-fns') | |
/** | |
* Implement Gatsby's Node APIs in this file. | |
* | |
* See: https://www.gatsbyjs.org/docs/node-apis/ | |
*/ | |
const { format } = require('date-fns') | |
async function createBlogPostPages (graphql, actions, reporter) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import Dialog from 'part:@sanity/components/dialogs/fullscreen' | |
import Cam from 'react-webcam' | |
export default class Webcam extends React.Component { | |
static defaultProps = { | |
selectedAssets: undefined | |
} | |
state = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script can be placed in the root of your studio folder, | |
* and be run with `sanity exec deleteDocsWithoutSchema.js --with-user-credentials | |
*/ | |
import client from 'part:@sanity/base/client' | |
const getSanitySchema = require('./node_modules/@sanity/core/lib/actions/graphql/getSanitySchema') | |
const Schema = getSanitySchema(process.cwd()) | |
const types = Schema._original.types.map(({name}) => name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import client from 'part:@sanity/base/client' | |
import ReactKanban from 'react-kanban-dnd'; | |
const columns = [ | |
] | |
const query = `{ | |
"draft": *[_type == "post" && editorial == "draft"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PortableText = require('@sanity/block-content-to-html') | |
const imageUrlBuilder = require('@sanity/image-url') | |
const { isFuture, parseISO } = require('date-fns') | |
const clientConfig = require('./client-config') | |
const { | |
getBlogUrl, | |
filterOutDocsPublishedInTheFuture | |
} = require('./nodeHelpers.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script context="module"> | |
import blocksToHtml from '@sanity/block-content-to-html' | |
import client from '../../sanityClient' | |
import urlBuilder from '@sanity/image-url' | |
import serializers from '../../components/serializers' | |
const urlFor = source => urlBuilder(client).image(source) | |
export async function preload({ params }) { | |
// the `slug` parameter is available because | |
// this file is called [slug].html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script context="module"> | |
import blocksToHtml from '@sanity/block-content-to-html' | |
import client from '../../sanityClient' | |
import serializers from '../../components/serializers' | |
export function preload({ params, query }) { | |
const projection = `{ | |
..., | |
excerpt[]{ | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.root { | |
display: block; | |
position: relative; | |
} | |
.lqip { | |
image-rendering: pixelated; | |
width: 100%; | |
opacity: 1; | |
transition: opacity 50ms 100ms ease-out; |