Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Stackbit integration #223

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions examples/archive/playground-azimuth/contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { makeSource } from 'contentlayer/source-files'
import 'contentlayer-stackbit-yaml-generator/types'

import * as documentTypes from './src/contentlayer'

export default makeSource({
contentDirPath: 'content',
documentTypes,
extensions: {
stackbit: {
pagesDir: 'content/pages',
dataDir: 'content/data',
},
stackbit: {
pagesDir: 'content/pages',
dataDir: 'content/data',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export const Blog = defineDocumentType(() => ({
resolve: urlFromFilePath,
},
},
extensions: {
stackbit: {
fields: {
title: { label: 'Title' },
},
file: 'blog.md',
stackbit: {
fields: {
title: { label: 'Title' },
},
file: 'blog.md',
},
}))
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,19 @@ export const Config = defineDocumentType(() => ({
// header: { type: 'embedded', model: Header, required: true },
footer: { type: 'nested', of: Footer, required: true },
},
extensions: {
stackbit: {
label: 'Site Configuration',
fields: {
title: { label: 'Title' },
path_prefix: { label: 'Base URL', hidden: true },
domain: { label: 'Domain' },
favicon: { label: 'Favicon' },
palette: { label: 'Color Palette' },
base_font: { label: 'Font' },
header: { label: 'Header Configuration' },
footer: { label: 'Footer Configuration' },
},
file: 'config.json',
},
stackbit: {
label: 'Site Configuration',
fields: {
title: { label: 'Title' },
path_prefix: { label: 'Base URL', hidden: true },
domain: { label: 'Domain' },
favicon: { label: 'Favicon' },
palette: { label: 'Color Palette' },
base_font: { label: 'Font' },
header: { label: 'Header Configuration' },
footer: { label: 'Footer Configuration' },
},
file: 'config.json',
},
}))

Expand All @@ -85,15 +83,13 @@ const Header = defineNestedType(() => ({
of: Action,
},
},
extensions: {
stackbit: {
label: 'Header Configuration',
fields: {
logo_img: { label: 'Logo' },
logo_img_alt: { label: 'Logo Alt Text' },
has_nav: { label: 'Enable Navigation' },
nav_links: { label: 'Navigation Links' },
},
stackbit: {
label: 'Header Configuration',
fields: {
logo_img: { label: 'Logo' },
logo_img_alt: { label: 'Logo Alt Text' },
has_nav: { label: 'Enable Navigation' },
nav_links: { label: 'Navigation Links' },
},
},
}))
Expand Down Expand Up @@ -127,17 +123,15 @@ const Footer = defineNestedType(() => ({
of: Action,
},
},
extensions: {
stackbit: {
label: 'Footer Configuration',
labelField: 'content',
fields: {
sections: { label: 'Sections' },
has_nav: { label: 'Enable Horizontal Navigation' },
nav_links: { label: 'Horizontal Navigation Links' },
content: { label: 'Footer Content' },
links: { label: 'Links' },
},
stackbit: {
label: 'Footer Configuration',
labelField: 'content',
fields: {
sections: { label: 'Sections' },
has_nav: { label: 'Enable Horizontal Navigation' },
nav_links: { label: 'Horizontal Navigation Links' },
content: { label: 'Footer Content' },
links: { label: 'Links' },
},
},
}))
Expand Down Expand Up @@ -196,19 +190,17 @@ const FooterForm = defineNestedType(() => ({
required: true,
},
},
extensions: {
stackbit: {
label: 'Footer Form',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
content: { label: 'Content' },
form_id: { label: 'Form ID' },
form_action: { label: 'Form Action' },
hide_labels: { label: 'Hide Labels' },
form_fields: { label: 'Form Fields' },
submit_label: { label: 'Submit Button Label' },
},
stackbit: {
label: 'Footer Form',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
content: { label: 'Content' },
form_id: { label: 'Form ID' },
form_action: { label: 'Form Action' },
hide_labels: { label: 'Hide Labels' },
form_fields: { label: 'Form Fields' },
submit_label: { label: 'Submit Button Label' },
},
},
}))
Expand All @@ -223,14 +215,12 @@ const FooterNav = defineNestedType(() => ({
of: Action,
},
},
extensions: {
stackbit: {
label: 'Vertical Navigation',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
nav_links: { label: 'Vertical Navigation Links' },
},
stackbit: {
label: 'Vertical Navigation',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
nav_links: { label: 'Vertical Navigation Links' },
},
},
}))
Expand All @@ -256,17 +246,15 @@ const FooterText = defineNestedType(() => ({
description: 'The text content of the section',
},
},
extensions: {
stackbit: {
label: 'Text',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
image: { label: 'Image' },
image_alt: { label: 'Image Alt Text' },
image_url: { label: 'Image URL' },
content: { label: 'Content' },
},
stackbit: {
label: 'Text',
labelField: 'title',
fields: {
...footerSectionBaseFieldsExtension,
image: { label: 'Image' },
image_alt: { label: 'Image Alt Text' },
image_url: { label: 'Image URL' },
content: { label: 'Content' },
},
},
}))
Loading