0.2.0 • Published 3 years ago

@undataforum/gatsby-theme-profiles-core v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

@undataforum/gatsby-theme-profiles-core

A Gatsby theme that adds a Profile interface and MdxProfile type to Gatsby sites.

Options

KeyDefault valueDescription
basePath/Basepath for deployments at path other than root.
collectionprofilesThe collection is added to Profile nodes. It is also part of the path.
contentPathcontent/profilesLocation of profile MDX files and assets. You can organize them in whichever way you want, e.g. place them in sub-directories.
mdxOtherwiseConfiguredfalseSet this flag to true if gatsby-plugin-mdx is already configured for your site.

Frontmatter

KeyRequiredDescription
slugThe slug is used to create the path to the generated profile and is used as ID to match profiles to other data types. The slug needs to be unique across collections.
avatarRelative path to avatar image located in the contentPath.
honorificHonorific title, e.g. Her Excellency or His Royal Highness.
firstNameFirst name.
lastNameLast name.
jobtitleJob title.
organizationOrganization.
descriptionThe default description for SEO purposes is the first paragraph in a profile MDX file. This value overrrides the default.
rolesOne or more roles that a profile can have. This is a YAML list with role keys as values, e.g. 2020-committee-member or 2018-organizer.

Profile interface

FieldTypeDescription
idID!Use slug instead of Gatsby node GUID.
collectionString!Collection to which this profile belongs.
avatarFile!If in the future data sources other than MDX are supported, avatar still needs to be of type File!, e.g. downoaded from Contentful to cache. Data sources need to support gatsby-image.
firstNameString!Used for sorting profiles.
lastNameString!Used for sorting profiles.
nameString!Display name.
honorificStringFrom frontmatter.
jobtitleStringFrom frontmatter.
organizationStringFrom frontmatter.
descriptionStringFrom frontmatter.
bodyString!A string representation of the body of the profile page.
roles[String!]A role is an identifier that can be used to lookup a role name. A profile can have more than one role.
pathString!Path to generated page.

Type MdxProfile implements Profile. If you prefer to use a data source other than MDX files, you can write a child theme that implements the Profile interface.