From 79649cf2544493fc138c8b846c0dac80e6e1b9e1 Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 28 Aug 2024 12:48:57 +0200 Subject: [PATCH 1/5] Handle singular and plural forms for word and minute counts in PostCard.astro and [...slug].astro Updated the word and minute count display in both PostCard.astro and [...slug].astro to correctly handle singular forms when the count is 1. This ensures proper grammar by dynamically selecting the appropriate form based on the count value. --- src/components/PostCard.astro | 18 +++++++++++------ src/pages/posts/[...slug].astro | 36 +++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/components/PostCard.astro b/src/components/PostCard.astro index 6ccf9b1cc..e6da8781d 100644 --- a/src/components/PostCard.astro +++ b/src/components/PostCard.astro @@ -61,12 +61,18 @@ const { remarkPluginFrontmatter } = await entry.render() { description || remarkPluginFrontmatter.excerpt } - -
-
{remarkPluginFrontmatter.words} {" " + i18n(I18nKey.wordsCount)}
-
|
-
{remarkPluginFrontmatter.minutes} {" " + i18n(I18nKey.minutesCount)}
-
+ +
+
+ {remarkPluginFrontmatter.words} {" "} + {remarkPluginFrontmatter.words === 1 ? i18n(I18nKey.wordCount) : i18n(I18nKey.wordsCount)} +
+
|
+
+ {remarkPluginFrontmatter.minutes} {" "} + {remarkPluginFrontmatter.minutes === 1 ? i18n(I18nKey.minuteCount) : i18n(I18nKey.minutesCount)} +
+
diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 5025db603..c010bc6d6 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -51,21 +51,27 @@ const jsonLd = {
- -
-
-
- -
-
{remarkPluginFrontmatter.words} {" " + i18n(I18nKey.wordsCount)}
-
-
-
- -
-
{remarkPluginFrontmatter.minutes} {" " + i18n(I18nKey.minutesCount)}
-
-
+ +
+
+
+ +
+
+ {remarkPluginFrontmatter.words} {" "} + {remarkPluginFrontmatter.words === 1 ? i18n(I18nKey.wordCount) : i18n(I18nKey.wordsCount)} +
+
+
+
+ +
+
+ {remarkPluginFrontmatter.minutes} {" "} + {remarkPluginFrontmatter.minutes === 1 ? i18n(I18nKey.minuteCount) : i18n(I18nKey.minutesCount)} +
+
+
From 4e703cb6c93f66f115e768e24851b20d096fa31c Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 28 Aug 2024 18:26:13 +0200 Subject: [PATCH 2/5] Update ArchivePanel.astro Add conditional logic to display 'postCount' for single post and 'postsCount' for multiple posts in the group list. --- src/components/ArchivePanel.astro | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index a3596c328..133875bc3 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -68,18 +68,22 @@ function formatTag(tag: string[]) {
{ groups.map(group => ( -
+
{group.year}
-
{group.posts.length} {i18n(I18nKey.postsCount)}
+
+ {group.posts.length} {group.posts.length === 1 ? i18n(I18nKey.postCount) : i18n(I18nKey.postsCount)} +
{group.posts.map(post => ( -
From 1791111db313b1c1fefc02c39dddf495ff08c40c Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 4 Sep 2024 18:29:06 +0200 Subject: [PATCH 3/5] Update README.md Added link to the Spanish readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 957ce27be..1433fe1c5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A static blog template built with [Astro](https://astro.build). [**πŸ“¦ Old Hexo Version**](https://github.com/saicaca/hexo-theme-vivia)   /    [**🌏 δΈ­ζ–‡**](https://github.com/saicaca/fuwari/blob/main/README.zh-CN.md)   /    [**🌏 ζ—₯本θͺž**](https://github.com/saicaca/fuwari/blob/main/README.ja-JP.md)   /    -[**🌏 ν•œκ΅­μ–΄**](https://github.com/saicaca/fuwari/blob/main/README.ko.md) +[**🌏 ν•œκ΅­μ–΄**](https://github.com/saicaca/fuwari/blob/main/README.ko.md)   /    +[**🌏 EspaΓ±ol**](https://github.com/saicaca/fuwari/blob/main/README.es.md) > README version: `2024-04-07` From 254b674068b75ffb004adab2f2b70ef21f4cdb77 Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 11 Sep 2024 00:03:00 +0200 Subject: [PATCH 4/5] Delete README.md --- README.md | 62 ------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 1433fe1c5..000000000 --- a/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# πŸ₯Fuwari - -A static blog template built with [Astro](https://astro.build). - -[**πŸ–₯️ Live Demo (Vercel)**](https://fuwari.vercel.app)   /    -[**πŸ“¦ Old Hexo Version**](https://github.com/saicaca/hexo-theme-vivia)   /    -[**🌏 δΈ­ζ–‡**](https://github.com/saicaca/fuwari/blob/main/README.zh-CN.md)   /    -[**🌏 ζ—₯本θͺž**](https://github.com/saicaca/fuwari/blob/main/README.ja-JP.md)   /    -[**🌏 ν•œκ΅­μ–΄**](https://github.com/saicaca/fuwari/blob/main/README.ko.md)   /    -[**🌏 EspaΓ±ol**](https://github.com/saicaca/fuwari/blob/main/README.es.md) - -> README version: `2024-04-07` - -![Preview Image](https://raw.githubusercontent.com/saicaca/resource/main/fuwari/home.png) - -## ✨ Features - -- [x] Built with [Astro](https://astro.build) and [Tailwind CSS](https://tailwindcss.com) -- [x] Smooth animations and page transitions -- [x] Light / dark mode -- [x] Customizable theme colors & banner -- [x] Responsive design -- [ ] Comments -- [x] Search -- [ ] TOC - -## πŸš€ How to Use - -1. [Generate a new repository](https://github.com/saicaca/fuwari/generate) from this template or fork this repository. -2. To edit your blog locally, clone your repository, run `pnpm install` AND `pnpm add sharp` to install dependencies. - - Install [pnpm](https://pnpm.io) `npm install -g pnpm` if you haven't. -3. Edit the config file `src/config.ts` to customize your blog. -4. Run `pnpm new-post ` to create a new post and edit it in `src/content/posts/`. -5. Deploy your blog to Vercel, Netlify, GitHub Pages, etc. following [the guides](https://docs.astro.build/en/guides/deploy/). You need to edit the site configuration in `astro.config.mjs` before deployment. - -## βš™οΈ Frontmatter of Posts - -```yaml ---- -title: My First Blog Post -published: 2023-09-09 -description: This is the first post of my new Astro blog. -image: /images/cover.jpg -tags: [Foo, Bar] -category: Front-end -draft: false ---- -``` - -## 🧞 Commands - -All commands are run from the root of the project, from a terminal: - -| Command | Action | -|:------------------------------------|:-------------------------------------------------| -| `pnpm install` AND `pnpm add sharp` | Installs dependencies | -| `pnpm dev` | Starts local dev server at `localhost:4321` | -| `pnpm build` | Build your production site to `./dist/` | -| `pnpm preview` | Preview your build locally, before deploying | -| `pnpm new-post ` | Create a new post | -| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` | -| `pnpm astro --help` | Get help using the Astro CLI | From 8aa99ec714ae0ff8be010bedf77d5f1cc2a2d290 Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 11 Sep 2024 00:04:48 +0200 Subject: [PATCH 5/5] Update ArchivePanel.astro --- src/components/ArchivePanel.astro | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index 133875bc3..8c5fa8c33 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -68,7 +68,7 @@ function formatTag(tag: string[]) {