remove author field

This commit is contained in:
2024-08-24 02:09:34 -05:00
parent 358d6b91c6
commit 7efa375427
6 changed files with 7 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
FROM node:20.17.0-alpine3.20 AS base FROM node:20.17.0-alpine3.20 AS base
LABEL version="0.5.2" LABEL version="0.5.3"
LABEL description="Astro based website to use as a profile" LABEL description="Astro based website to use as a profile"
ENV PNPM_HOME="/pnpm" ENV PNPM_HOME="/pnpm"

View File

@@ -26,17 +26,12 @@ type Skills = {
skill_3_description: string; skill_3_description: string;
} }
type Author = {
name: string
}
export type Post = { export type Post = {
slug: string; slug: string;
title: string; title: string;
content: string; content: string;
image: string; image: string;
published_date: string; published_date: string;
author: Author;
tags: string[]; tags: string[];
image_alt: string; image_alt: string;
} }

View File

@@ -1,7 +1,7 @@
{ {
"name": "site-profile", "name": "site-profile",
"type": "module", "type": "module",
"version": "0.5.2", "version": "0.5.3",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",
"start": "astro dev", "start": "astro dev",

View File

@@ -18,7 +18,7 @@ const global = await directus.request(readSingleton("global"));
const posts = await directus.request( const posts = await directus.request(
readItems("posts", { readItems("posts", {
fields: ['*', { author: ['*'] }], fields: ['*'],
sort: ["-published_date"], sort: ["-published_date"],
}) })
); );

View File

@@ -13,7 +13,7 @@ const global = await directus.request(readSingleton("global"));
const posts = await directus.request( const posts = await directus.request(
readItems("posts", { readItems("posts", {
fields: ['*', { author: ['*'] }], fields: ['*'],
sort: ["-published_date"], sort: ["-published_date"],
}) })
); );
@@ -37,7 +37,7 @@ const posts = await directus.request(
<PortfolioPreview posts={post} /> <PortfolioPreview posts={post} />
</li> </li>
)) ))
} }
</Grid> </Grid>
</main> </main>
<ContactCTA /> <ContactCTA />

View File

@@ -11,7 +11,7 @@ import { readItems } from "@directus/sdk";
export async function getStaticPaths() { export async function getStaticPaths() {
const posts = await directus.request(readItems("posts", { const posts = await directus.request(readItems("posts", {
fields: ['*', { author: ['*'] }], fields: ['*'],
})); }));
return posts.map((post) => ({ params: { slug: post.slug }, props: post })); return posts.map((post) => ({ params: { slug: post.slug }, props: post }));
} }
@@ -28,7 +28,7 @@ const published_date: string = new Date(post.published_date).toLocaleDateString(
<a class="back-link" href="/projects/"><Icon icon="arrow-left" /> Projects</a> <a class="back-link" href="/projects/"><Icon icon="arrow-left" /> Projects</a>
<Hero <Hero
title={post.title} title={post.title}
tagline=`Published by ${post.author.name} on ${published_date}` tagline=`Published on ${published_date}`
align="start" align="start"
> >
<div class="details"> <div class="details">