diff --git a/package.json b/package.json index a2abf7a..467d796 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,11 @@ "test": "jest --verbose --passWithNoTests", "lint": "next lint" }, + "standard": { + "ignore": [ + "/tina/**/*" + ] + }, "dependencies": { "@highlightjs/cdn-assets": "^11.11.1", "date-fns": "^4.1.0", diff --git a/src/components/Book/Book.jsx b/src/components/Book/Book.jsx index 7631a6f..53b6bf0 100644 --- a/src/components/Book/Book.jsx +++ b/src/components/Book/Book.jsx @@ -3,7 +3,7 @@ import { NextSeo } from 'next-seo' import Link from 'next/link' import React from 'react' -function Book({ attributes, html }) { +function Book ({ attributes, html }) { return ( <>

{attributes.title}
by {attributes.author}

@@ -23,7 +23,7 @@ function Book({ attributes, html }) {
Back... {attributes.pubdate &&

{formatDate(attributes.pubdate)}

} -
(no review)

" }} /> +
(no review)

' }} />
diff --git a/src/components/BookListItem/BookListItem.jsx b/src/components/BookListItem/BookListItem.jsx index ede5351..164d11e 100644 --- a/src/components/BookListItem/BookListItem.jsx +++ b/src/components/BookListItem/BookListItem.jsx @@ -1,13 +1,15 @@ import style from './BookListItem.module.css' import Link from 'next/link' -export default function BookListItem({ href, title, author, stars, readDate, url, thumbnailUrl, tags, review }) { +export default function BookListItem ({ href, title, author, stars, readDate, url, thumbnailUrl, tags, review }) { return (
-
+

diff --git a/src/lib/content.js b/src/lib/content.js index 48300fc..2be0456 100644 --- a/src/lib/content.js +++ b/src/lib/content.js @@ -56,7 +56,7 @@ export function getStaticEntries (contentPath) { const directoryItems = fs.readdirSync(contentPath, { withFileTypes: true }) return directoryItems.map((dirent) => getMarkdownEntry(`${dirent.path}/${dirent.name}`) - ); + ) } export function getContentTags (contentPath) { diff --git a/src/pages/library/index.js b/src/pages/library/index.js index 3a8936d..cffd6b7 100644 --- a/src/pages/library/index.js +++ b/src/pages/library/index.js @@ -10,18 +10,18 @@ export const getStaticProps = () => { const bookEntries = getStaticEntries('./content/books') .sort((a, b) => { return b.attributes.readDate - a.attributes.readDate - }); + }) return { props: { - // Silliness to make sure dates don't get passed to the + // Silliness to make sure dates don't get passed to the // page function below as [object Object] bookEntries: JSON.parse(JSON.stringify(bookEntries)) } } } -export default function Library({ bookEntries }) { +export default function Library ({ bookEntries }) { return ( ) -} \ No newline at end of file +} diff --git a/tina/config.js b/tina/config.js index 5878b42..e78e396 100644 --- a/tina/config.js +++ b/tina/config.js @@ -1,11 +1,11 @@ -import { defineConfig } from "tinacms"; +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 || - "main"; + 'main' export default defineConfig({ branch, @@ -16,121 +16,121 @@ export default defineConfig({ token: process.env.TINA_TOKEN, build: { - outputFolder: "admin", - publicFolder: "public", + outputFolder: 'admin', + publicFolder: 'public' }, media: { tina: { - mediaRoot: "", - publicFolder: "public", - }, + mediaRoot: '', + publicFolder: 'public' + } }, // See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/schema/ schema: { collections: [ { - name: "books", - label: "Library", + name: 'books', + label: 'Library', path: 'content/books', match: { - include: "*" + include: '*' }, - format: "md", + format: 'md', fields: [ { - type: "string", - name: "title", - label: "Title", + type: 'string', + name: 'title', + label: 'Title', isTitle: true, - required: true, + required: true }, { type: 'string', - name: "author", - label: "Author", + name: 'author', + label: 'Author', required: true }, { type: 'number', - name: "stars", - label: "Stars", + name: 'stars', + label: 'Stars', required: true }, { type: 'datetime', - name: "readDate", - label: "Read date", + name: 'readDate', + label: 'Read date', required: false }, { type: 'string', - name: "url", - label: "URL", + name: 'url', + label: 'URL', required: false }, { type: 'string', - name: "thumbnailUrl", - label: "Thumbnail URL", + name: 'thumbnailUrl', + label: 'Thumbnail URL', required: false }, { type: 'string', - name: "tags", - label: "Tags", + name: 'tags', + label: 'Tags', required: true }, { - type: "rich-text", - name: "body", - label: "Body", - isBody: true, - }, + type: 'rich-text', + name: 'body', + label: 'Body', + isBody: true + } ] }, { - name: "writing", - label: "Writing", - path: "content/writing", + name: 'writing', + label: 'Writing', + path: 'content/writing', match: { - include: "*" + include: '*' }, - format: "md", + format: 'md', fields: [ { - type: "string", - name: "title", - label: "Title", + type: 'string', + name: 'title', + label: 'Title', isTitle: true, - required: true, + required: true }, { - type: "datetime", - name: "pubdate", - label: "Publish Date", + type: 'datetime', + name: 'pubdate', + label: 'Publish Date' }, { - type: "string", + type: 'string', ui: { - component: "textarea" + component: 'textarea' }, - name: "desc", - label: "Description", + name: 'desc', + label: 'Description' }, { - type: "string", - name: "tags", - label: "Tags", + type: 'string', + name: 'tags', + label: 'Tags', list: true }, { - type: "rich-text", - name: "body", - label: "Body", - isBody: true, - }, - ], - }, - ], - }, -}); + type: 'rich-text', + name: 'body', + label: 'Body', + isBody: true + } + ] + } + ] + } +})