-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Website structure Add news and members pages. Also update events to new collection and create new content folder. * unified page item width
- Loading branch information
Showing
16 changed files
with
2,777 additions
and
1,343 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "News" | ||
description: "News description" | ||
pubDate: "Aug 25 2024" | ||
heroImage: "/social_img.jpg" | ||
badge: "NEW" | ||
--- | ||
|
||
<!-- CSS Code: Place this code in the document's head (between the 'head' tags) --> | ||
<style> | ||
table.GeneratedTable { | ||
width: 100%; | ||
background-color: #ffffff; | ||
border-collapse: collapse; | ||
border-width: 2px; | ||
border-color: #68624b; | ||
border-style: solid; | ||
color: #000000; | ||
} | ||
|
||
table.GeneratedTable td, table.GeneratedTable th { | ||
border-width: 2px; | ||
border-color: #68624b; | ||
border-style: solid; | ||
padding: 3px; | ||
} | ||
|
||
table.GeneratedTable thead { | ||
background-color: #ffcc00; | ||
} | ||
|
||
.highlight-red-text { | ||
color: #FF0000; /* 這是一個代表紅色的色碼,亮紅色 */ | ||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* 添加文字陰影 */ | ||
} | ||
|
||
</style> | ||
|
||
#### 新聞測試 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
import { EventsSchema } from "../content/config"; | ||
import BaseLayout from "./BaseLayout.astro"; | ||
import dayjs from "dayjs"; | ||
import localizedFormat from "dayjs/plugin/localizedFormat"; | ||
export interface Props extends EventsSchema {} | ||
const { title, description, pubDate, updatedDate, heroImage, badge } = | ||
Astro.props; | ||
dayjs.extend(localizedFormat); | ||
const displayDate = dayjs(pubDate).format("ll"); | ||
import { Image } from "@astrojs/image/components"; | ||
--- | ||
|
||
<BaseLayout title={title} description={description} image={heroImage}> | ||
<main class="md:flex md:justify-center"> | ||
<article class="prose prose-lg max-w-[750px] prose-img:mx-auto"> | ||
{ | ||
heroImage && ( | ||
<Image | ||
aspectRatio={"16:9"} | ||
width={750} | ||
height={422} | ||
format="webp" | ||
src={heroImage} | ||
alt={title} | ||
class="w-full mb-6" | ||
/> | ||
) | ||
} | ||
<h1 class="title my-2 text-4xl font-bold">{title}</h1> | ||
{pubDate && <time>{displayDate}</time>} | ||
<br /> | ||
{badge && <div class="badge badge-secondary my-1">{badge}</div>} | ||
{ | ||
updatedDate && ( | ||
<div> | ||
{" "} | ||
Last updated on <time>{updatedDate}</time>{" "} | ||
</div> | ||
) | ||
} | ||
<div class="divider my-2"></div> | ||
<slot /> | ||
</article> | ||
</main> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
import { NewsSchema } from "../content/config"; | ||
import BaseLayout from "./BaseLayout.astro"; | ||
import dayjs from "dayjs"; | ||
import localizedFormat from "dayjs/plugin/localizedFormat"; | ||
export interface Props extends NewsSchema {} | ||
const { title, description, pubDate, updatedDate, heroImage, badge } = | ||
Astro.props; | ||
dayjs.extend(localizedFormat); | ||
const displayDate = dayjs(pubDate).format("ll"); | ||
import { Image } from "@astrojs/image/components"; | ||
--- | ||
|
||
<BaseLayout title={title} description={description} image={heroImage}> | ||
<main class="md:flex md:justify-center"> | ||
<article class="prose prose-lg max-w-[750px] prose-img:mx-auto"> | ||
{ | ||
heroImage && ( | ||
<Image | ||
aspectRatio={"16:9"} | ||
width={750} | ||
height={422} | ||
format="webp" | ||
src={heroImage} | ||
alt={title} | ||
class="w-full mb-6" | ||
/> | ||
) | ||
} | ||
<h1 class="title my-2 text-4xl font-bold">{title}</h1> | ||
{pubDate && <time>{displayDate}</time>} | ||
<br /> | ||
{badge && <div class="badge badge-secondary my-1">{badge}</div>} | ||
{ | ||
updatedDate && ( | ||
<div> | ||
{" "} | ||
Last updated on <time>{updatedDate}</time>{" "} | ||
</div> | ||
) | ||
} | ||
<div class="divider my-2"></div> | ||
<slot /> | ||
</article> | ||
</main> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
import BaseLayout from "../../layouts/BaseLayout.astro"; | ||
import HorizontalCard from "../../components/HorizontalCard.astro"; | ||
import { getCollection } from "astro:content"; | ||
export async function getStaticPaths({ paginate }) { | ||
const posts = await getCollection("events"); | ||
posts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); | ||
return paginate(posts, { pageSize: 10 }); | ||
} | ||
const { page } = Astro.props; | ||
--- | ||
|
||
<BaseLayout title="Events" sideBarActiveItemID="events"> | ||
<div class="mb-5"> | ||
<div class="text-3xl w-full font-bold">Events</div> | ||
</div> | ||
|
||
{ | ||
page.data.length === 0 ? ( | ||
<div class="bg-base-200 border-l-4 border-secondary w-full p-4 min-w-full"> | ||
<p class="font-bold">Sorry!</p> | ||
<p>There are no events posts to show at the moment. Check back later!</p> | ||
</div> | ||
) : ( | ||
<ul> | ||
{page.data.map((post) => ( | ||
<> | ||
<HorizontalCard | ||
title={post.data.title} | ||
img={post.data.heroImage} | ||
desc={post.data.description} | ||
url={"/events/" + post.slug} | ||
target="_self" | ||
badge={post.data.badge} | ||
/> | ||
<div class="divider my-0" /> | ||
</> | ||
))} | ||
</ul> | ||
) | ||
} | ||
|
||
<div class="flex justify-between"> | ||
{ | ||
page.url.prev ? ( | ||
<a href={page.url.prev} class="btn btn-ghost my-10 mx-5"> | ||
{" "} | ||
<svg | ||
class="h-6 w-6 fill-current md:h-8 md:w-8" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
> | ||
<path d="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z" /> | ||
</svg>{" "} | ||
Recent posts | ||
</a> | ||
) : ( | ||
<div /> | ||
) | ||
} | ||
{ | ||
page.url.next ? ( | ||
<a href={page.url.next} class="btn btn-ghost my-10 mx-5"> | ||
Older Posts{" "} | ||
<svg | ||
class="h-6 w-6 fill-current md:h-8 md:w-8" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
> | ||
{" "} | ||
<path d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" /> | ||
</svg> | ||
</a> | ||
) : ( | ||
<div /> | ||
) | ||
} | ||
</div> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
import { CollectionEntry, getCollection } from 'astro:content'; | ||
import { EventsSchema } from '../../content/config'; | ||
import EventLayout from '../../layouts/EventsLayout.astro'; | ||
export async function getStaticPaths() { | ||
const EventEntries = await getCollection('events'); | ||
return EventEntries.map(entry => ( { | ||
params: { slug: entry.slug }, props: { entry }, | ||
} )); | ||
} | ||
interface Props { | ||
entry: CollectionEntry<"events">; | ||
} | ||
const { entry } = Astro.props; | ||
const Event : EventsSchema = entry.data; | ||
const { Content } = await entry.render(); | ||
--- | ||
|
||
<EventLayout | ||
title={Event.title} | ||
description={Event.description} | ||
pubDate={Event.pubDate} | ||
heroImage={Event.heroImage} | ||
updatedDate={Event.updatedDate} | ||
badge={Event.badge}> | ||
<Content/> | ||
</EventLayout> |
Oops, something went wrong.