initial commit after project creation
This commit is contained in:
35
tina/templates/navbar-ui.template.tsx
Normal file
35
tina/templates/navbar-ui.template.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { Template } from "tinacms";
|
||||
import { titleCase } from "title-case";
|
||||
|
||||
export const itemTemplate: Template = {
|
||||
label: "Item",
|
||||
name: "item",
|
||||
ui: {
|
||||
itemProps: (item) => {
|
||||
return {
|
||||
label: `🔗 ${titleCase(
|
||||
item?.slug?.split("/").at(-1).split(".").at(0).replaceAll("-", " ") ??
|
||||
"Unnamed Menu Item"
|
||||
)}`,
|
||||
};
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: "slug",
|
||||
label: "Page",
|
||||
type: "reference",
|
||||
collections: ["docs"],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const submenusLabel: Pick<Template, "label" | "name" | "ui"> = {
|
||||
label: "Submenu",
|
||||
name: "items",
|
||||
ui: {
|
||||
itemProps: (item) => ({
|
||||
label: `🗂️ ${item?.title ?? "Unnamed Menu Group"}`,
|
||||
}),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user