Update launch configuration and enhance PostSummary component layout

This commit is contained in:
Valentin Popov 2024-09-17 22:27:55 +00:00
parent 43f80a7b6e
commit cf85f10724
Signed by: Valentin Popov
GPG Key ID: AE3CE523DAAA8401
3 changed files with 26 additions and 30 deletions

2
.vscode/launch.json vendored
View File

@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"command": "./node_modules/.bin/astro dev --host 0.0.0.0",
"name": "Development server",
"request": "launch",
"type": "node-terminal"

View File

@ -6,7 +6,9 @@ import sitemap from "@astrojs/sitemap";
export default defineConfig({
site: "https://popov.link",
output: "hybrid",
adapter: cloudflare(),
adapter: cloudflare({
imageService: "compile",
}),
integrations: [sitemap()],
markdown: {
remarkPlugins: [remarkReadingTime],

View File

@ -7,45 +7,39 @@ type Props = {
};
const { post } = Astro.props;
const { remarkPluginFrontmatter } = await post.render();
const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY");
---
<style lang="scss">
@import "../scss/_variables.scss";
/* Post */
.post {
a {
color: $colorText;
display: block;
padding-bottom: 3rem;
}
.link {
color: $colorText;
h2 {
color: $colorBlossom;
font-size: 1.25em;
margin: 0.5em 0;
}
/* Meta */
.meta {
padding-bottom: 1.5rem;
}
.date {
div {
font-size: $fontSizeBase * 0.75;
opacity: 0.5;
}
.tag {
display: none;
}
</style>
<article class="post">
<h2><a class="link" href={`/blog/${post.slug}`}>{post.data.title}</a></h2>
<div class="meta">
<time class="date" datetime={post.data.pubDate.toISOString()}>
{dayjs(post.data.pubDate.toString()).format("YYYY-MM-DD")}
</time>
<ul class="tag">
<li><a href="#">tag1</a></li>
<li><a href="#">tag2</a></li>
</ul>
<a href={`/blog/${post.slug}`}>
<article>
<div>
<time datetime={post.data.pubDate.toISOString()}>{formattedDate}</time>
<span>•</span>
<span>{remarkPluginFrontmatter.minutesRead}</span>
</div>
<h2>{post.data.title}</h2>
<p>{post.data.description}</p>
<a href={`/blog/${post.slug}`}>Read More</a>
</article>
</article>
</a>