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

TinaCMS #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./node_modules/.bin/eleventy --serve",
"tina": "tinacms dev -c \"./node_modules/.bin/eleventy --serve\"",
"build": "./node_modules/.bin/eleventy",
"buildtest": "tinacms build && ./node_modules/.bin/eleventy",
"clear": "rm -rf .cache",
"pagefind": "npx pagefind --source public --glob \"**/*.html\""
},
Expand Down
4 changes: 2 additions & 2 deletions src/posts/2023/2023-12-22-just-2024-things.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Just 2024 Things
title: Just 2023 Things
permalink: /just-2024-things/index.html
date: 2023-12-22T10:11:45.223Z
excerpt: "2024 year in review"
excerpt: "2023 year in review"
layout: post
tags:
- Personal
Expand Down
1 change: 1 addition & 0 deletions tina/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__generated__
179 changes: 179 additions & 0 deletions tina/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import { defineConfig } from "tinacms";

// Your hosting provider likely exposes this as an environment variable
const branch =
process.env.GITHUB_BRANCH ||
process.env.VERCEL_GIT_COMMIT_REF ||
process.env.HEAD ||
"master";

const dateTime = (new Date()).toISOString().split('T')[0];

export default defineConfig({
branch,

// Get this from tina.io
clientId: process.env.NEXT_PUBLIC_TINA_CLIENT_ID,
// Get this from tina.io
token: process.env.TINA_TOKEN,

build: {
outputFolder: "public",
publicFolder: "src",
},
media: {
tina: {
mediaRoot: "",
publicFolder: "src/assets",
},
},
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/schema/
schema: {
collections: [
{
name: "link",
label: "Links",
path: "src/links",
ui: {
defaultItem: {
date: new Date().toISOString(),
},
layout: {
readonly: true,
},
filename: {
readonly: true,
slugify: (values) => {
return `${dateTime}-${values.title
?.toLowerCase()
.replace(/ /g, '-')}`
},
},
},
fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "string",
name: "link",
label: "Link",
required: true,
},
{
type: "datetime",
name: "date",
label: "Date",
required: true,
},
{
type: "string",
name: "comment",
label: "Comment",
}
]
},
{
name: "post",
label: "Posts",
path: "src/posts",
indexes: [{
name: "date",
fields: [
{ name: "date" }
],
}],
ui: {
defaultItem: {
layout: "post",
date: new Date().toISOString(),
},
layout: {
readonly: true,
},
filename: {
readonly: true,
slugify: (values) => {
return `${dateTime}-${values.title
?.toLowerCase()
.replace(/ /g, '-')}`
},
},
},
fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "string",
name: "excerpt",
label: "Excerpt",
required: true,
},
{
type: "string",
name: "layout",
label: "Layout",
required: true,
},
{
type: "datetime",
name: "date",
label: "Date",
required: true,
},
{
label: 'Tags',
name: 'tags',
type: 'string',
list: true,
options: [
{ value: 'ActivityPub', label: 'ActivityPub' },
{ value: 'AdventOfCode', label: 'AdventOfCode' },
{ value: 'AI', label: 'AI' },
{ value: 'Alfred', label: 'Alfred' },
{ value: 'Apps', label: 'Apps' },
{ value: 'BabyKnight', label: 'BabyKnight' },
{ value: 'Development', label: 'Development' },
{ value: 'DIY', label: 'DIY' },
{ value: 'Eleventy', label: 'Eleventy' },
{ value: 'Food', label: 'Food' },
{ value: 'Games', label: 'Games' },
{ value: 'Hackathon', label: 'Hackathon' },
{ value: 'Homescreen', label: 'Homescreen' },
{ value: 'Lego', label: 'Lego' },
{ value: 'Letters', label: 'Letters' },
{ value: 'MacOS', label: 'MacOS' },
{ value: 'Mastodon', label: 'Mastodon' },
{ value: 'Movies', label: 'Movies' },
{ value: 'Music', label: 'Music' },
{ value: 'OpenWeb', label: 'OpenWeb' },
{ value: 'Personal', label: 'Personal' },
{ value: 'Podcasting', label: 'Podcasting' },
{ value: 'Recipes', label: 'Recipes' },
{ value: 'Shortcuts', label: 'Shortcuts' },
{ value: 'SocialMedia', label: 'SocialMedia' },
{ value: 'StJude', label: 'StJude' },
{ value: 'TV', label: 'TV' },
{ value: 'YearInReview', label: 'YearInReview' },
]
},
{
type: "rich-text",
name: "body",
label: "Body",
isBody: true,
},
],
},
],
},
});
1 change: 1 addition & 0 deletions tina/tina-lock.json

Large diffs are not rendered by default.