From 2e924f69aadb05c1856ea73e719099e1eabb5b6d Mon Sep 17 00:00:00 2001 From: OtomeSound Date: Sun, 5 Jan 2025 20:03:03 +0800 Subject: [PATCH] feat: adjust Menu active feature and speedup deploy by pnpm cache --- .github/workflows/deploy.yml | 11 +++++++++-- src/layouts/Layout.astro | 2 +- src/layouts/Menu.vue | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c934efd..69cbbbf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,16 +17,23 @@ jobs: - name: Checkout your repository using git uses: actions/checkout@v4 + - name: Use pnpm as package manager + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + - name: Use Node.js uses: actions/setup-node@v4 with: node-version: lts/iron + cache: 'pnpm' - name: Install dependencies - run: npm install + run: pnpm install - name: Build the project - run: npm run build + run: pnpm run build - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4 diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index c6b0989..d250706 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -4,7 +4,7 @@ import Menu from './Menu.vue'; import '@assets/scss/layout.scss'; -const currentPath = Astro.url.pathname; +const currentPath = Astro.url.pathname.replace('.html', ''); --- diff --git a/src/layouts/Menu.vue b/src/layouts/Menu.vue index 694b760..399dc23 100644 --- a/src/layouts/Menu.vue +++ b/src/layouts/Menu.vue @@ -3,7 +3,7 @@ import { ref } from 'vue'; import { Menu as MenuIcon } from 'lucide-vue-next'; type Props = { - path: String; + path: string; }; const { path } = defineProps();