import { c as createComponent } from './astro-component_Y0jc7Trv.mjs';
import 'piccolore';
import { h as renderComponent, r as renderTemplate, m as maybeRenderHead, f as addAttribute } from './server_CW1mBpZH.mjs';
import { $ as $$Layout } from './Layout_DdK69uya.mjs';
import { g as getCollection } from './_astro_content_Beg-Bg2V.mjs';

const $$Index = createComponent(async ($$result, $$props, $$slots) => {
  const posts = await getCollection("blog");
  const sortedPosts = posts.sort(
    (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
  );
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "บล็อก", "description": "บทความและความรู้ด้าน Digital Transformation, AI และการตลาดออนไลน์สำหรับ SMEs ไทย", "data-astro-cid-5tznm7mj": true }, { "default": async ($$result2) => renderTemplate` ${maybeRenderHead()}<section class="page-header" data-astro-cid-5tznm7mj> <div class="container" data-astro-cid-5tznm7mj> <h1 data-astro-cid-5tznm7mj>บล็อก</h1> <p data-astro-cid-5tznm7mj>บทความและความรู้ด้านเทคโนโลยีและการตลาดสำหรับธุรกิจ SMEs ไทย</p> </div> </section> <section class="blog-list" data-astro-cid-5tznm7mj> <div class="container" data-astro-cid-5tznm7mj> <div class="posts-grid" data-astro-cid-5tznm7mj> ${sortedPosts.map((post) => renderTemplate`<article class="post-card" data-astro-cid-5tznm7mj> <h2 data-astro-cid-5tznm7mj> <a${addAttribute(`/blog/${post.slug}`, "href")} data-astro-cid-5tznm7mj>${post.data.title}</a> </h2> <p class="post-meta" data-astro-cid-5tznm7mj> <span data-astro-cid-5tznm7mj>${post.data.author}</span> <span data-astro-cid-5tznm7mj>•</span> <time${addAttribute(post.data.pubDate.toISOString(), "datetime")} data-astro-cid-5tznm7mj> ${post.data.pubDate.toLocaleDateString("th-TH", {
    year: "numeric",
    month: "long",
    day: "numeric"
  })} </time> </p> <p class="post-description" data-astro-cid-5tznm7mj>${post.data.description}</p> <div class="post-tags" data-astro-cid-5tznm7mj> ${post.data.tags?.slice(0, 3).map((tag) => renderTemplate`<span class="tag" data-astro-cid-5tznm7mj>${tag}</span>`)} </div> </article>`)} </div> </div> </section> ` })}`;
}, "/Users/kunthawatgreethong/Gitea/moreminimore-new/src/pages/blog/index.astro", void 0);

const $$file = "/Users/kunthawatgreethong/Gitea/moreminimore-new/src/pages/blog/index.astro";
const $$url = "/blog";

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  default: $$Index,
  file: $$file,
  url: $$url
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
