Added a bullshit build without the CMS to make sure I can deploy something

This commit was merged in pull request #5.
This commit is contained in:
2023-08-31 20:11:39 +02:00
parent f7009a0732
commit 4209edf31e
4 changed files with 90 additions and 86 deletions

View File

@@ -6,96 +6,96 @@ import { PageBlocksTestimonial } from "../../tina/__generated__/types";
import { tinaField } from "tinacms/dist/react"; import { tinaField } from "tinacms/dist/react";
export const Testimonial = ({ data }: { data: PageBlocksTestimonial }) => { export const Testimonial = ({ data }: { data: PageBlocksTestimonial }) => {
return ( return (
<Section color={data.color}> <Section color={ data.color }>
<Container size="large"> <Container size="large">
<blockquote> <blockquote>
<div <div
className={`relative z-10 max-w-3xl mx-auto text-4xl lg:text-5xl font-bold tracking-normal text-center title-font ${ className={ `relative z-10 max-w-3xl mx-auto text-4xl lg:text-5xl font-bold tracking-normal text-center title-font ${
data.color === "primary" data.color === "primary"
? `text-white` ? "text-white"
: `text-gray-700 dark:text-gray-50` : "text-gray-700 dark:text-gray-50"
}`} }` }
> >
<span <span
className={`block opacity-15 text-8xl absolute inset-y-1/2 transform translate-y-2 -left-4 leading-4 -z-1`} className={ "block opacity-15 text-8xl absolute inset-y-1/2 transform translate-y-2 -left-4 leading-4 -z-1" }
> >
&ldquo; &ldquo;
</span> </span>
<p <p
data-tina-field={tinaField(data, `quote`)} data-tina-field={ tinaField(data, "quote") }
className="relative opacity-95" className="relative opacity-95"
> >
{data.quote} { data.quote }
</p> </p>
<span <span
className={`block opacity-15 text-8xl absolute inset-y-1/2 transform translate-y-3 -right-4 leading-4 -z-1`} className={ "block opacity-15 text-8xl absolute inset-y-1/2 transform translate-y-3 -right-4 leading-4 -z-1" }
> >
&rdquo; &rdquo;
</span> </span>
</div> </div>
<div className={`my-8 flex-grow-0`}> <div className={ "my-8 flex-grow-0" }>
<span <span
className={`block mx-auto h-0.5 w-1/6 ${ className={ `block mx-auto h-0.5 w-1/6 ${
data.color === "primary" data.color === "primary"
? `bg-blue-600` ? "bg-blue-600"
: `bg-gray-200 dark:bg-gray-700` : "bg-gray-200 dark:bg-gray-700"
}`} }` }
></span> />
</div> </div>
<footer className="text-center"> <footer className="text-center">
<p <p
data-tina-field={tinaField(data, `author`)} data-tina-field={ tinaField(data, "author") }
className={`tracking-wide title-font font-bold text-lg ${ className={ `tracking-wide title-font font-bold text-lg ${
data.color === "primary" data.color === "primary"
? `text-blue-200` ? "text-blue-200"
: `text-blue-500 dark:text-blue-300` : "text-blue-500 dark:text-blue-300"
}`} }` }
> >
{data.author} { data.author }
</p> </p>
</footer> </footer>
</blockquote> </blockquote>
</Container> </Container>
</Section> </Section>
); );
}; };
export const testimonialBlockSchema: Template = { export const testimonialBlockSchema: Template = {
name: "testimonial", name: "testimonial",
label: "Testimonial", label: "Testimonial",
ui: { ui: {
previewSrc: "/blocks/testimonial.png", previewSrc: "/blocks/testimonial.png",
defaultItem: { defaultItem: {
quote: quote:
"There are only two hard things in Computer Science: cache invalidation and naming things.", "There are only two hard things in Computer Science: cache invalidation and naming things.",
author: "Phil Karlton", author: "Phil Karlton",
color: "primary", color: "primary"
}
}, },
}, fields: [
fields: [ {
{ type: "string",
type: "string", ui: {
ui: { component: "textarea"
component: "textarea", },
}, label: "Quote",
label: "Quote", name: "quote"
name: "quote", },
}, {
{ type: "string",
type: "string", label: "Author",
label: "Author", name: "author"
name: "author", },
}, {
{ type: "string",
type: "string", label: "Color",
label: "Color", name: "color",
name: "color", options: [
options: [ { label: "Default", value: "default" },
{ label: "Default", value: "default" }, { label: "Tint", value: "tint" },
{ label: "Tint", value: "tint" }, { label: "Primary", value: "primary" }
{ label: "Primary", value: "primary" }, ]
], }
}, ]
],
}; };

View File

@@ -1,4 +1,5 @@
module.exports = { module.exports = {
distDir: "build",
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
test: /\.svg$/i, test: /\.svg$/i,

View File

@@ -7,7 +7,8 @@
"build": "tinacms build && next build", "build": "tinacms build && next build",
"start": "tinacms build && next start", "start": "tinacms build && next start",
"export": "npm run build && next export", "export": "npm run build && next export",
"lint": "eslint . --ext .ts,.tsx" "lint": "eslint . --ext .ts,.tsx",
"bullshit:build": "tinacms dev -c \"next build\""
}, },
"devDependencies": { "devDependencies": {
"@svgr/webpack": "^6.3.1", "@svgr/webpack": "^6.3.1",

View File

@@ -44,6 +44,8 @@ export const getStaticProps = async ({ params }) => {
* *
* So a blog post at "content/posts/hello.md" would * So a blog post at "content/posts/hello.md" would
* be viewable at http://localhost:3000/posts/hello * be viewable at http://localhost:3000/posts/hello
*
* @returns {Promise} A promise with static paths.
*/ */
export const getStaticPaths = async () => { export const getStaticPaths = async () => {
const postsListData = await client.queries.postConnection(); const postsListData = await client.queries.postConnection();