diff --git a/.gitignore b/.gitignore index 16d54bb..3e71462 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ pnpm-debug.log* # jetbrains setting folder .idea/ + +# obsidian +.obsidian/ \ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro index 610a9a9..ffa8f44 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -34,8 +34,7 @@ const currentPath = Astro.url.pathname; Andrew Moses - BlogBlog Resume diff --git a/src/pages/blog.astro b/src/pages/blog.astro index 73f7811..1b124ee 100644 --- a/src/pages/blog.astro +++ b/src/pages/blog.astro @@ -5,10 +5,10 @@ const allPosts = await Astro.glob("./blog/*.md"); function groupPostsByYearAndMonth(posts) { const grouped = {}; - posts.forEach(post => { + posts.forEach((post) => { const date = new Date(post.frontmatter.date); const year = date.getFullYear(); - const month = date.toLocaleString('default', { month: 'long' }); + const month = date.toLocaleString("default", { month: "long" }); const key = `${year}-${month}`; if (!grouped[key]) { @@ -21,27 +21,33 @@ function groupPostsByYearAndMonth(posts) { } const groupedPosts = groupPostsByYearAndMonth(allPosts); -const sortedKeys = Object.keys(groupedPosts).sort((a, b) => new Date(b) - new Date(a)); // Sort keys in reverse order +const sortedKeys = Object.keys(groupedPosts).sort( + (a, b) => new Date(b) - new Date(a) +); // Sort keys in reverse order --- - {sortedKeys.map((key) => { - const [year, month] = key.split("-"); - return ( -
-

{month} {year}

- -
- ); - })} + { + sortedKeys.map((key) => { + const [year, month] = key.split("-"); + return ( +
+

+ {month} {year} +

+ +
+ ); + }) + }