From 9db5ae81039155cc07e5b2e79a4065119ef813e1 Mon Sep 17 00:00:00 2001
From: Al Asad Nur Riyad
Date: Sat, 9 Nov 2024 03:18:21 +0600
Subject: [PATCH] Update to Nuxt 3.14 and Replace npm with pnpm (#72)
Signed-off-by: nurRiyad
---
.eslintrc | 4 -
.github/workflows/build.yml | 21 +-
.prettierrc | 5 +
.vscode/settings.json | 4 +-
LICENSE.md | 2 +-
README.md | 5 +-
app.vue | 4 +-
assets/css/tailwind.css | 1 -
components/OgImage/About.vue | 13 +-
components/OgImage/Test.vue | 24 +-
components/archive/card.vue | 18 +-
components/archive/hero.vue | 4 +-
components/blog/Header.vue | 10 +-
components/blog/Toc.vue | 10 +-
components/blog/card.vue | 14 +-
components/blog/empty.vue | 8 +-
components/category/card.vue | 3 +-
components/category/hero.vue | 4 +-
components/category/topic.vue | 3 +-
components/footer/connect.vue | 8 +-
components/footer/developer.vue | 4 +-
components/footer/link.vue | 22 +-
components/footer/site.vue | 6 +-
components/logo/404.vue | 550 +-
components/logo/dogpow.vue | 5 +-
components/logo/dogs.vue | 10 +-
components/main/footer.vue | 10 +-
components/main/header.vue | 14 +-
components/main/hero.vue | 6 +-
components/main/recent.vue | 6 +-
components/main/trending.vue | 8 +-
.../4. fetch-content-data-render-pages.md | 1 -
content/blogs/5. vue3-awesome-library.md | 2 +-
.../blogs/6. how-to-fix-vuex-type-issue.md | 17 +-
data/index.ts | 32 +-
eslint.config.mjs | 8 +
nuxt.config.ts | 40 +-
package-lock.json | 19855 ----------------
package.json | 16 +-
pages/[...slug].vue | 2 +-
pages/about.vue | 22 +-
pages/blogs/[blog].vue | 15 +-
pages/blogs/index.vue | 86 +-
pages/categories/[category].vue | 3 +-
pages/categories/index.vue | 10 +-
pnpm-lock.yaml | 15019 ++++++++++++
server/routes/rss.xml.ts | 4 +-
tailwind.config.js | 5 +-
utils/helper.ts | 3 +-
49 files changed, 15735 insertions(+), 20211 deletions(-)
delete mode 100644 .eslintrc
create mode 100644 .prettierrc
create mode 100644 eslint.config.mjs
delete mode 100644 package-lock.json
create mode 100644 pnpm-lock.yaml
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index d83a003e..00000000
--- a/.eslintrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "extends": "@antfu",
- "ignorePatterns":["/content/**","/.github/**"]
-}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b0f4d2b9..48c059f5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,21 +14,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Check Code
+ - name: Checkout
uses: actions/checkout@v4
- - name: Setup Node.js
+ - uses: pnpm/action-setup@v4
+ name: Install pnpm
+
+ - name: Install Node.js
uses: actions/setup-node@v4
with:
- node-version: '20'
- cache: 'npm'
+ node-version: 22
+ cache: 'pnpm'
- - name: Install dependency
- run: npm ci
+ - name: Install dependencies
+ run: pnpm install
- name: Check Linting
- run: npm run lint
+ run: pnpm run lint
+ - name: Check Format
+ run: pnpm run format
- name: Playgourd build check
- run: npm run build
+ run: pnpm run build
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..b52a92b1
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "singleQuote": true,
+ "semi": false,
+ "printWidth": 100
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 56fa3354..85d22f53 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,6 +1,6 @@
{
- "prettier.enable": false,
- "editor.formatOnSave": false,
+ "editor.formatOnSave": true,
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
diff --git a/LICENSE.md b/LICENSE.md
index b79df407..7f2b5861 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
index 367aa74c..f95ba132 100644
--- a/README.md
+++ b/README.md
@@ -12,9 +12,10 @@
- Nuxt Blog built with [Nuxt3](https://nuxt.com), [Nuxt-Content2](https://content.nuxtjs.org/blog/announcing-v2/), [Vue3](https://vuejs.org) & [TailwindCss](https://tailwindcss.com/)
+Nuxt Blog built with [Nuxt3](https://nuxt.com), [Nuxt-Content2](https://content.nuxtjs.org/blog/announcing-v2/), [Vue3](https://vuejs.org) & [TailwindCss](https://tailwindcss.com/)
## Features
+
- Write blog with markdown file
- Auto generate category from blog post
- Blog list page with search and pagination
@@ -25,8 +26,8 @@
- Dark and light mode
- Server Side Rendered(SSR) with Nuxt3
-
## How to Make This Blog Template Yours in 5 Minutes
+
- Clone this repo or use it as a template
- Go to ./data/index.ts file & add your personal info
- Then head over to the ./content/blogs folder to add new blogs
diff --git a/app.vue b/app.vue
index 24b11525..703151ac 100644
--- a/app.vue
+++ b/app.vue
@@ -10,7 +10,7 @@ useHead({
-
+
@@ -39,7 +39,7 @@ useHead({
filter: blur(1rem);
}
-html.dark{
+html.dark {
color-scheme: dark;
}
diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css
index 9bb37ee6..b5c61c95 100644
--- a/assets/css/tailwind.css
+++ b/assets/css/tailwind.css
@@ -1,4 +1,3 @@
-
@tailwind base;
@tailwind components;
@tailwind utilities;
diff --git a/components/OgImage/About.vue b/components/OgImage/About.vue
index 34b90252..947d9c9a 100644
--- a/components/OgImage/About.vue
+++ b/components/OgImage/About.vue
@@ -1,10 +1,4 @@
@@ -39,7 +36,10 @@ const formattedLink = computed(() => {
xmlns="http://www.w3.org/2000/svg"
>
-
+
{
-
+
diff --git a/components/archive/card.vue b/components/archive/card.vue
index f01d27a2..5f8c7417 100644
--- a/components/archive/card.vue
+++ b/components/archive/card.vue
@@ -25,7 +25,9 @@ withDefaults(defineProps(), {
-
+
(), {
/>
-
+
{{ title }}
{{ description }}
-
+
-
{{ date }}
+
{{ date }}
diff --git a/components/archive/hero.vue b/components/archive/hero.vue
index 8b04d149..1cd54426 100644
--- a/components/archive/hero.vue
+++ b/components/archive/hero.vue
@@ -6,7 +6,9 @@ import { blogsPage } from '~/data'
-
+
{{ blogsPage.title }}
diff --git a/components/blog/Header.vue b/components/blog/Header.vue
index 5b5959ee..d628fd0b 100644
--- a/components/blog/Header.vue
+++ b/components/blog/Header.vue
@@ -14,7 +14,7 @@ withDefaults(defineProps(), {
alt: 'no-img',
description: 'no description',
date: 'no-date',
- tags: () => ([]),
+ tags: () => [],
})
@@ -29,7 +29,9 @@ withDefaults(defineProps(), {
width="600"
class="m-auto rounded-2xl shadow-lg h-32 md:h-72 w-4/6 md:w-4/5 content-center object-cover"
/>
-
+
{{ description }}
@@ -41,7 +43,9 @@ withDefaults(defineProps
(), {
- {{ tag }}
+ {{
+ tag
+ }}
diff --git a/components/blog/Toc.vue b/components/blog/Toc.vue
index 5a3690c7..d036eb97 100644
--- a/components/blog/Toc.vue
+++ b/components/blog/Toc.vue
@@ -6,13 +6,13 @@ const links = articles?.body?.toc?.links || []
-
+
-
- Table Of Content
-
+
Table Of Content
{{ link.text }}
diff --git a/components/blog/card.vue b/components/blog/card.vue
index 3205f143..f350cc94 100644
--- a/components/blog/card.vue
+++ b/components/blog/card.vue
@@ -25,7 +25,9 @@ withDefaults(defineProps(), {
-
+
(), {
:alt="alt"
/>
-
+
{{ date }}
@@ -42,11 +44,15 @@ withDefaults(defineProps
(), {
- {{ tag }}
+ {{
+ tag
+ }}
-
+
{{ title }}
diff --git a/components/blog/empty.vue b/components/blog/empty.vue
index fbb72b6c..c53ca7f6 100644
--- a/components/blog/empty.vue
+++ b/components/blog/empty.vue
@@ -1,5 +1,7 @@
-
+
-
+
No Post Available
diff --git a/components/category/card.vue b/components/category/card.vue
index 262cdef3..1ec6a085 100644
--- a/components/category/card.vue
+++ b/components/category/card.vue
@@ -35,8 +35,7 @@ const picAColor = ref(`${color.at(getRandomInt(0, 8))}`)