this is good
This commit is contained in:
parent
bbb910ce4f
commit
9f4014376a
|
@ -1,14 +1,19 @@
|
|||
import tailwind from '@astrojs/tailwind';
|
||||
import { defineConfig } from 'astro/config';
|
||||
import flattenListItems from 'mdast-flatten-listitem-paragraphs';
|
||||
|
||||
import react from '@astrojs/react';
|
||||
import keystatic from '@keystatic/astro';
|
||||
import tailwind from '@astrojs/tailwind';
|
||||
import flattenListItems from 'mdast-flatten-listitem-paragraphs';
|
||||
import mdx from '@astrojs/mdx';
|
||||
|
||||
const prod = process.env.NODE_ENV === 'production';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: import.meta.env.PROD ? 'https://filipesm.eu' : 'http://localhost:1234',
|
||||
integrations: [tailwind(), mdx()],
|
||||
integrations: [tailwind(), mdx(), ...(!prod ? [keystatic(), react()] : [])],
|
||||
markdown: {
|
||||
remarkPlugins: [flattenListItems],
|
||||
},
|
||||
output: prod ? 'static' : 'hybrid',
|
||||
});
|
||||
|
|
26
keystatic.config.ts
Normal file
26
keystatic.config.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { config, fields, collection } from '@keystatic/core';
|
||||
|
||||
export default config({
|
||||
storage: {
|
||||
kind: 'local',
|
||||
},
|
||||
collections: {
|
||||
library: collection({
|
||||
label: 'Library items',
|
||||
slugField: 'slug',
|
||||
path: 'src/content/library/**',
|
||||
schema: {
|
||||
slug: fields.slug({ name: { label: 'Slug' } }),
|
||||
title: fields.text({
|
||||
label: 'Title',
|
||||
validation: { isRequired: true },
|
||||
}),
|
||||
checkedOut: fields.checkbox({ label: 'Checked out?' }),
|
||||
link: fields.url({ label: 'Link', validation: { isRequired: true } }),
|
||||
description: fields.text({ label: 'Description', multiline: true }),
|
||||
date: fields.date({ label: 'Date', validation: { isRequired: true } }),
|
||||
mainAuthor: fields.text({ label: 'Main author(s)' }),
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
|
@ -14,10 +14,14 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^1.1.5",
|
||||
"@astrojs/react": "^3.3.0",
|
||||
"@astrojs/rss": "^4.0.5",
|
||||
"@astrojs/tailwind": "^5.0.3",
|
||||
"@keystatic/astro": "^5.0.0",
|
||||
"@keystatic/core": "^0.5.11",
|
||||
"astro": "^4.0.6",
|
||||
"mdast-flatten-listitem-paragraphs": "^1.0.0",
|
||||
"react": "^18.2.0",
|
||||
"sharp": "^0.33.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in a new issue