Skip to content

Commit

Permalink
Merge pull request #1 from tuatmcc/feat/fix-build
Browse files Browse the repository at this point in the history
[fix]: tempolarily fixed build
  • Loading branch information
OJII3 authored Aug 8, 2024
2 parents 378c5e7 + c7c0e39 commit 3c3aa8e
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface Props {
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const { title, description, path, og } = Astro.props;
const { title, description, og } = Astro.props;
const image = og.image ?? new URL('/images/og-image.jpg', Astro.url);
---
Expand Down
4 changes: 2 additions & 2 deletions src/content/blog/first-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'First post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 08 2022'
heroImage: '/blog-placeholder-3.jpg'
date: 'Jul 08 2022'
image: '/blog-placeholder-3.jpg'
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Expand Down
4 changes: 2 additions & 2 deletions src/content/blog/markdown-style-guide.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Markdown Style Guide'
description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
pubDate: 'Jul 01 2022'
heroImage: '/blog-placeholder-1.jpg'
date: 'Jul 01 2022'
image: '/blog-placeholder-1.jpg'
---

Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
Expand Down
4 changes: 2 additions & 2 deletions src/content/blog/second-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Second post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 15 2022'
heroImage: '/blog-placeholder-4.jpg'
date: 'Jul 15 2022'
image: '/blog-placeholder-4.jpg'
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Expand Down
4 changes: 2 additions & 2 deletions src/content/blog/third-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Third post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 22 2022'
heroImage: '/blog-placeholder-2.jpg'
date: 'Jul 22 2022'
image: '/blog-placeholder-2.jpg'
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Expand Down
4 changes: 2 additions & 2 deletions src/content/blog/using-mdx.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Using MDX'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 02 2022'
heroImage: '/blog-placeholder-5.jpg'
date: 'Jul 02 2022'
image: '/blog-placeholder-5.jpg'
---

This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
Expand Down
12 changes: 6 additions & 6 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineCollection, z } from 'astro:content';
import { defineCollection, z } from "astro:content";

const blog = defineCollection({
type: 'content',
type: "content",
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
description: z.string(),
// Transform string to Date object
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
heroImage: z.string().optional(),
date: z.coerce.date(),
lastmod: z.coerce.date().optional(),
tags: z.array(z.string()).optional(),
image: z.string().optional(),
}),
});

Expand Down
10 changes: 5 additions & 5 deletions src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FormattedDate from '../components/FormattedDate.astro';
type Props = CollectionEntry<'blog'>['data'];
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
const { title, description, date, lastmod, image } = Astro.props;
---

<html lang="en">
Expand Down Expand Up @@ -59,16 +59,16 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
<main class="w-full m-0">
<article>
<div class="w-full">
{heroImage && <img width={1020} height={510} src={heroImage} alt="" class="block mx-auto rounded-2xl shadow-red-950" />}
{image && <img width={1020} height={510} src={image} alt="" class="block mx-auto rounded-2xl shadow-red-950" />}
</div>
<div class="w-720 mx-auto p-1 max-w-full text-gray-800">
<div class="title">
<div class="date">
<FormattedDate date={pubDate} />
<FormattedDate date={date} />
{
updatedDate && (
lastmod && (
<div class="last-updated-on">
Last updated on <FormattedDate date={updatedDate} />
Last updated on <FormattedDate date={lastmod} />
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Props {
}
};
const site = Astro.site ?? "";
// const site = Astro.site ?? "";
---

<!doctype html>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/blog/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { getCollection } from 'astro:content';
import FormattedDate from '../../components/FormattedDate.astro';
const posts = (await getCollection('blog')).sort(
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
(a, b) => a.data.date.valueOf() - b.data.date.valueOf()
);
---

<!doctype html>
<html lang="en">
<head>
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} path='/blog' pagefind={false} og={{enabled: true}} />
<style>
main {
width: 960px;
Expand Down Expand Up @@ -94,10 +94,10 @@ const posts = (await getCollection('blog')).sort(
posts.map((post) => (
<li>
<a href={`/blog/${post.slug}/`}>
<img width={720} height={360} src={post.data.heroImage} alt="" />
<img width={720} height={360} src={post.data.image} alt="" />
<h4 class="title">{post.data.title}</h4>
<p class="date">
<FormattedDate date={post.data.pubDate} />
<FormattedDate date={post.data.date} />
</p>
</a>
</li>
Expand Down
16 changes: 0 additions & 16 deletions src/pages/rss.xml.js

This file was deleted.

0 comments on commit 3c3aa8e

Please sign in to comment.