Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ name: Build Test
on:
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened, edited]
workflow_dispatch:

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Check source branch for main PR
if: github.base_ref == 'main' && github.head_ref != 'develop'
run: |
echo "PRs to main branch are only allowed from develop branch"
exit 1

- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Install, build, and upload your site
Expand Down
4 changes: 0 additions & 4 deletions src/constants/menu.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export const menu = [
{
path: '/',
label: 'Home',
},
{
path: '/blog',
label: 'Blog',
Expand Down
38 changes: 2 additions & 36 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,41 +1,7 @@
---
import FormattedDate from '@/components/FormattedDate.astro';
import PageLayout from '@/layouts/PageLayout.astro';
import { getCollection } from 'astro:content';

const posts = (await getCollection('blog')).sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
return Astro.redirect('/blog');
---

<PageLayout title="Home">
<ul>
{
posts.map((post) => (
<li class="py-5">
<article>
<a
href={`/blog/${post.slug}/`}
class="hover:text-emerald-600 flex flex-col gap-1"
>
<h2 class="text-3xl font-bold">{post.data.title}</h2>
<p class="text-gray-500 text-sm">
<span>
작성일:
<FormattedDate datetime={post.data.pubDate} />
</span>
{post.data.updatedDate && (
<span>
수정일:
<FormattedDate datetime={post.data.updatedDate} />
</span>
)}
</p>
<p class="text-slate-500">{post.data.description}</p>
</a>
</article>
</li>
))
}
</ul>
</PageLayout>
<PageLayout title="Home" />